Class Book

All Implemented Interfaces:
DataInterface

public class Book extends BookData
Class representing a book in a library. Extends BookData to inherit common book data fields.
  • Constructor Details

    • Book

      public Book(int bookId, String title, String author, String ISBN, String genre, String subgenre, String nationality, String publicationFormat, int publishedYear, String publisherName, String deweyDecimal, boolean isAvailable, String borrowedByUserName)
      Constructor for Book.
      Parameters:
      bookId - book bookId
      title - book title
      author - book author
      ISBN - book ISBN
      genre - book genre
      subgenre - book subgenre
      nationality - book author's nationality
      publicationFormat - book publication format
      publishedYear - book published year
      publisherName - book publisher's name
      deweyDecimal - book Dewey decimal number
      isAvailable - book availability status
      borrowedByUserName - book's borrower username, if any
  • Method Details

    • printData

      public void printData()
      Prints the book's data in a formatted table.
      Specified by:
      printData in interface DataInterface
      Overrides:
      printData in class BookData
    • printHeader

      public void printHeader()
      Prints the header for the book table in a formatted table.
      Specified by:
      printHeader in interface DataInterface
      Overrides:
      printHeader in class BookData
    • printRow

      public void printRow()
      Prints the book's data in a formatted table row. This method overrides the printRow() method from the superclass and prints the book's data in a formatted table row. The data includes the book ID, title, author, ISBN, and availability status. The data is formatted using the ANSI_YELLOW and ANSI_RESET constants for coloring.
      Specified by:
      printRow in interface DataInterface
      Overrides:
      printRow in class BookData
    • printFooter

      public void printFooter()
      Prints the footer for the book table in a formatted table.
      Specified by:
      printFooter in interface DataInterface
      Overrides:
      printFooter in class BookData