Class Magazine
java.lang.Object
com.university.bookstore.model.Material
com.university.bookstore.model.Magazine
- All Implemented Interfaces:
Comparable<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 ClassesModifier and TypeClassDescriptionstatic enumFrequency of magazine publication.Nested classes/interfaces inherited from class com.university.bookstore.model.Material
Material.MaterialType -
Constructor Summary
Constructors -
Method Summary
-
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 Numbertitle- magazine titlepublisher- publishing companyprice- price per issueyear- publication yearissueNumber- issue numberfrequency- publication frequencycategory- magazine category/genre
-
-
Method Details
-
getCreator
Description copied from class:MaterialAbstract method to get the creator/author/artist of the material. Implementation varies by material type.- Specified by:
getCreatorin classMaterial- Returns:
- the creator's name
-
getDisplayInfo
Description copied from class:MaterialAbstract method to get a formatted display string. Each material type should provide its own formatting.- Specified by:
getDisplayInfoin classMaterial- Returns:
- formatted display string
-
getDiscountRate
public double getDiscountRate()Description copied from class:MaterialHook method for discount rate. Default is no discount. Subclasses can override to provide type-specific discounts.- Overrides:
getDiscountRatein classMaterial- Returns:
- discount rate between 0.0 and 1.0
-
calculateAnnualSubscription
public double calculateAnnualSubscription()Calculates annual subscription cost with discount.- Returns:
- annual subscription price
-
getIssn
-
getPublisher
-
getIssueNumber
public int getIssueNumber() -
getFrequency
-
getCategory
-
toString
-