# Class PrintedBook

java.lang.Object
com.university.bookstore.model.Material
com.university.bookstore.model.PrintedBook

All Implemented Interfaces:
  `Comparable<Material>`

public class PrintedBook extends Material
Represents a physical printed book in the bookstore inventory. Extends Material class to demonstrate inheritance.

This class maintains backward compatibility with the original Book class while integrating into the new polymorphic material hierarchy.

Since:
  2024-09-15
Version:
  2.0
Author:
  Navid Mohaghegh

- ## Nested Class Summary

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

  `Material.MaterialType`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PrintedBook(String isbn, String title, String author, double price, int year)`
  Convenience constructor for backward compatibility.
  `PrintedBook(String isbn, String title, String author, double price, int year, int pages, String publisher, boolean hardcover)`
  Creates a new PrintedBook with validation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `estimateReadingTime(int wordsPerMinute)`
  Calculates estimated reading time based on average reading speed.
  `String`
  `getAuthor()`
  `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`
  `getIsbn()`
  `int`
  `getPages()`
  `String`
  `getPublisher()`
  `boolean`
  `isHardcover()`
  `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

  - ### PrintedBook

    public PrintedBook(String isbn, String title, String author, double price, int year, int pages, String publisher, boolean hardcover)
    Creates a new PrintedBook with validation.
    Parameters:
      `isbn` - the International Standard Book Number
      `title` - the book title
      `author` - the primary author
      `price` - the price in dollars
      `year` - the publication year
      `pages` - number of pages
      `publisher` - the publishing company
      `hardcover` - true if hardcover, false if paperback

  - ### PrintedBook

    public PrintedBook(String isbn, String title, String author, double price, int year)
    Convenience constructor for backward compatibility.

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

  - ### getIsbn

    public String getIsbn()

  - ### getAuthor

    public String getAuthor()

  - ### getPages

    public int getPages()

  - ### getPublisher

    public String getPublisher()

  - ### isHardcover

    public boolean isHardcover()

  - ### estimateReadingTime

    public double estimateReadingTime(int wordsPerMinute)
    Calculates estimated reading time based on average reading speed.
    Parameters:
      `wordsPerMinute` - reading speed (typical: 200-250)
    Returns:
      estimated hours to read

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Material`