# 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

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `Magazine.PublicationFrequency`
  Frequency of magazine publication.

  ### Nested classes/interfaces inherited from class com.university.bookstore.model.Material

  `Material.MaterialType`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Magazine(String issn, String title, String publisher, double price, int year, int issueNumber, String frequency, String category)`
  Creates a new Magazine.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `calculateAnnualSubscription()`
  Calculates annual subscription cost with discount.
  `String`
  `getCategory()`
  `String`
  `getCreator()`
  Abstract method to get the creator/author/artist of the material.
  `double`
  `getDiscountRate()`
  Hook method for discount rate.
  `String`
  `getDisplayInfo()`
  Abstract method to get a formatted display string.
  `String`
  `getFrequency()`
  `String`
  `getIssn()`
  `int`
  `getIssueNumber()`
  `String`
  `getPublisher()`
  `String`
  `toString()`

  ### Methods inherited from class com.university.bookstore.model.Material

  `compareTo, equals, getDiscountedPrice, getId, getPrice, getTitle, getType, getYear, hashCode`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## 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`