Class Magazine

java.lang.Object
com.university.bookstore.model.Material
com.university.bookstore.model.Magazine
All Implemented Interfaces:
Comparable<Material>

public class Magazine extends Material
Represents a magazine in the store inventory. Demonstrates inheritance from Material base class.
Since:
2024-09-15
Version:
2.0
Author:
Navid Mohaghegh
  • Constructor Details

    • Magazine

      public Magazine(String issn, String title, String publisher, double price, int year, int issueNumber, String frequency, String category)
      Creates a new Magazine.
      Parameters:
      issn - International Standard Serial Number
      title - magazine title
      publisher - publishing company
      price - price per issue
      year - publication year
      issueNumber - issue number
      frequency - publication frequency
      category - magazine category/genre
  • Method Details

    • getCreator

      public String getCreator()
      Description copied from class: Material
      Abstract method to get the creator/author/artist of the material. Implementation varies by material type.
      Specified by:
      getCreator in class Material
      Returns:
      the creator's name
    • getDisplayInfo

      public String getDisplayInfo()
      Description copied from class: Material
      Abstract method to get a formatted display string. Each material type should provide its own formatting.
      Specified by:
      getDisplayInfo in class Material
      Returns:
      formatted display string
    • getDiscountRate

      public double getDiscountRate()
      Description copied from class: Material
      Hook method for discount rate. Default is no discount. Subclasses can override to provide type-specific discounts.
      Overrides:
      getDiscountRate in class Material
      Returns:
      discount rate between 0.0 and 1.0
    • calculateAnnualSubscription

      public double calculateAnnualSubscription()
      Calculates annual subscription cost with discount.
      Returns:
      annual subscription price
    • getIssn

      public String getIssn()
    • getPublisher

      public String getPublisher()
    • getIssueNumber

      public int getIssueNumber()
    • getFrequency

      public String getFrequency()
    • getCategory

      public String getCategory()
    • toString

      public String toString()
      Overrides:
      toString in class Material