Class BookData

java.lang.Object
com.miniproject.two.BookData
All Implemented Interfaces:
DataInterface
Direct Known Subclasses:
Book

public abstract class BookData extends Object implements DataInterface
This abstract class BookData is the base class for Book and Periodical classes. It contains common fields and methods for all types of literature.
  • Constructor Details

    • BookData

      public BookData(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)
      Constructs a BookData object with the given parameters.
      Parameters:
      bookId - the ID of the book
      title - the title of the book
      author - the author of the book
      isbn - the ISBN of the book
      genre - the genre of the book
      subgenre - the subgenre of the book
      nationality - the nationality of the book's author
      publicationFormat - the publication format of the book
      publishedYear - the year the book was published
      publisherName - the name of the publisher
      deweyDecimal - the Dewey decimal classification of the book
      isAvailable - whether the book is available or not
      borrowedByUserName - the username of the user who borrowed the book
  • Method Details

    • getBookId

      public int getBookId()
      Returns the ID of the book.
      Returns:
      the ID of the book
    • getTitle

      public String getTitle()
      Returns the title of the literature.
      Returns:
      the title of the literature
    • getAuthor

      public String getAuthor()
      Returns the author of the literature.
      Returns:
      the author of the literature
    • getISBN

      public String getISBN()
      Returns the ISBN of the literature.
      Returns:
      the ISBN of the literature
    • getGenre

      public String getGenre()
      Returns the genre of the literature.
      Returns:
      the genre of the literature
    • getSubgenre

      public String getSubgenre()
      Returns the subgenre of the literature.
      Returns:
      the subgenre of the literature
    • getNationality

      public String getNationality()
      Returns the nationality of the author.
      Returns:
      the nationality of the author
    • getPublicationFormat

      public String getPublicationFormat()
      Returns the publication format of the literature.
      Returns:
      the publication format of the literature
    • getPublishedYear

      public int getPublishedYear()
      Returns the year the literature was published.
      Returns:
      the year the literature was published
    • getPublisherName

      public String getPublisherName()
      Returns the name of the publisher.
      Returns:
      the name of the publisher
    • getDeweyDecimal

      public String getDeweyDecimal()
      Returns the Dewey decimal classification.
      Returns:
      the Dewey decimal classification
    • isAvailable

      public boolean isAvailable()
      Returns whether the literature is available or not.
      Returns:
      true if the literature is available, false otherwise
    • getBorrowedByUserName

      public String getBorrowedByUserName()
      Returns the username of the user who borrowed the literature.
      Returns:
      the username of the user who borrowed the literature
    • setAvailable

      public void setAvailable(boolean available)
      Sets whether the literature is available or not.
      Parameters:
      available - whether the literature is available or not
    • setBorrowedByUserName

      public void setBorrowedByUserName(String borrowedByUserName)
      Sets the username of the user who borrowed the literature.
      Parameters:
      borrowedByUserName - the username of the user who borrowed the literature
    • setTitle

      public void setTitle(String title)
      Sets the title of the literature.
      Parameters:
      title - the title of the literature
    • setGenre

      public void setGenre(String genre)
      Sets the genre of the literature.
      Parameters:
      genre - the genre of the literature
    • setSubgenre

      public void setSubgenre(String subgenre)
      Sets the subgenre of the literature.
      Parameters:
      subgenre - the subgenre of the literature
    • setAuthor

      public void setAuthor(String author)
      Sets the author of the literature.
      Parameters:
      author - the author of the literature
    • setNationality

      public void setNationality(String nationality)
      Sets the nationality of the author.
      Parameters:
      nationality - the nationality of the author
    • setISBN

      public void setISBN(String isbn)
      Sets the ISBN of the literature.
      Parameters:
      isbn - the ISBN of the literature
    • setPublicationFormat

      public void setPublicationFormat(String publicationFormat)
      Sets the publication format of the literature.
      Parameters:
      publicationFormat - the publication format of the literature
    • setPublishedYear

      public void setPublishedYear(int publishedYear)
      Sets the year the literature was published.
      Parameters:
      publishedYear - the year the literature was published
    • setPublisherName

      public void setPublisherName(String publisherName)
      Sets the name of the publisher.
      Parameters:
      publisherName - the name of the publisher
    • setDeweyDecimal

      public void setDeweyDecimal(String deweyDecimal)
      Sets the Dewey decimal classification of the literature.
      Parameters:
      deweyDecimal - the Dewey decimal classification of the literature
    • printData

      public void printData()
      Prints the data of the implementing class. This method is meant to output the data in a specific format such as a table. The exact format and contents depend on the implementing class.
      Specified by:
      printData in interface DataInterface
    • printHeader

      public void printHeader()
      Prints the header for the data structure. This method is intended to print the header section, which usually consists of column names or other relevant headings. The format of the header is determined by the implementing class.
      Specified by:
      printHeader in interface DataInterface
    • printRow

      public void printRow()
      Prints a row of data. This method is responsible for printing a single row of data. The contents and formatting of the row depend on the implementing class.
      Specified by:
      printRow in interface DataInterface
    • printFooter

      public void printFooter()
      Prints the footer for the data structure. This method is intended to print the footer section, which could include summary information or any other relevant details. The format of the footer is determined by the implementing class.
      Specified by:
      printFooter in interface DataInterface