Class ManageBook

java.lang.Object
com.jahnreil_stratpoint.ManageBook

public class ManageBook extends Object
Manages a list of books and provides operations to manipulate them.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a ManageBook object with an initial list of books.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an audiobook to the book list based on user input.
    void
    addAudioBook(Book book, int bookid, String bookType, String fileFormat, double fileSize, String audioFormat, String bitrate)
    Adds an AudioBook to the book list with complete information.
    void
    addAudioBook(Book book, int bookid, String bookType, String fileFormat, String audioFormat, String bitrate)
    Adds an AudioBook to the book list with basic information and no file size specified.
    void
    addBook(int bookid, String bookType, String title, String isbn)
    Adds a book with basic information (title, ISBN) to the book list.
    void
    addBook(int bookid, String bookType, String title, String author, String isbn)
    Adds a book with title, author, and ISBN to the book list.
    void
    addBook(int bookid, String bookType, String title, String author, String isbn, String genre, String publisher, LocalDate publicationDate, String synopsis, String language)
    Adds a book with complete information to the book list.
    void
    addBook(ArrayList<Book> bookList)
    Allows the user to add different types of books to the book list.
    void
    addEBook(Book book, int bookid, String bookType, String fileFormat)
    Adds an E-Book to the book list with basic information.
    void
    addEBook(Book book, int bookid, String bookType, String fileFormat, double fileSize)
    Adds an E-Book to the book list.
    void
    Adds an eBook to the book list based on user input.
    void
    addHardBack(Book book, int bookid, String bookType, int pagecount)
    Adds a hardback book with basic information (title, ISBN, page count) to the book list.
    void
    addHardBack(Book book, int bookid, String bookType, int pagecount, double weight)
    Adds a hardback book with information including page count and weight to the book list.
    void
    addHardBack(Book book, int bookid, String bookType, String coverType, int pageCount, double weightKG)
    Adds a hardback book with complete information to the book list.
    void
    Adds a hardback book to the book list based on user input.
    void
    Adds a regular book to the book list based on user input.
    findBook(ArrayList<Book> bookList, int id)
    Finds a book in the provided list by its ID.
    void
    Removes a book from the list by its ID after prompting the user to enter the ID.
    static void
    Displays a paginated catalog of books from the provided list.
    void
    Searches for books in the provided list based on user input criteria (Title, Author, ISBN, Genre, Publisher, Language).
    static void
    viewBook(ArrayList<Book> bookList)
    Displays detailed information about a specific book from the provided list based on user input.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ManageBook

      public ManageBook(ArrayList<Book> bookList)
      Constructs a ManageBook object with an initial list of books.
      Parameters:
      bookList - The initial list of books to manage.
  • Method Details

    • addBook

      public void addBook(ArrayList<Book> bookList)
      Allows the user to add different types of books to the book list.
      Parameters:
      bookList - The list of books to which the new book will be added.
    • addRegularBook

      public void addRegularBook()
      Adds a regular book to the book list based on user input.
    • addHardBackBook

      public void addHardBackBook()
      Adds a hardback book to the book list based on user input.
    • addEBookBook

      public void addEBookBook()
      Adds an eBook to the book list based on user input.
    • addAudioBook

      public void addAudioBook()
      Adds an audiobook to the book list based on user input.
    • addBook

      public void addBook(int bookid, String bookType, String title, String isbn)
      Adds a book with basic information (title, ISBN) to the book list.
      Parameters:
      bookid - The unique identifier of the book.
      bookType - The type of the book (e.g., Regular, HardBack, EBook, AudioBook).
      title - The title of the book.
      isbn - The ISBN (International Standard Book Number) of the book.
    • addBook

      public void addBook(int bookid, String bookType, String title, String author, String isbn)
      Adds a book with title, author, and ISBN to the book list.
      Parameters:
      bookid - The unique identifier of the book.
      bookType - The type of the book (e.g., Regular, HardBack, EBook, AudioBook).
      title - The title of the book.
      author - The author of the book.
      isbn - The ISBN (International Standard Book Number) of the book.
    • addBook

      public void addBook(int bookid, String bookType, String title, String author, String isbn, String genre, String publisher, LocalDate publicationDate, String synopsis, String language)
      Adds a book with complete information to the book list.
      Parameters:
      bookid - The unique identifier of the book.
      bookType - The type of the book (e.g., Regular, HardBack, EBook, AudioBook).
      title - The title of the book.
      author - The author of the book.
      isbn - The ISBN (International Standard Book Number) of the book.
      genre - The genre of the book.
      publisher - The publisher of the book.
      publicationDate - The publication date of the book.
      synopsis - A brief synopsis or summary of the book.
      language - The language in which the book is written.
    • addHardBack

      public void addHardBack(Book book, int bookid, String bookType, int pagecount)
      Adds a hardback book with basic information (title, ISBN, page count) to the book list.
      Parameters:
      book - The book object containing basic information (title, ISBN).
      bookid - The unique identifier of the book.
      bookType - The type of the book (e.g., Regular, HardBack, EBook, AudioBook).
      pagecount - The number of pages in the hardback book.
    • addHardBack

      public void addHardBack(Book book, int bookid, String bookType, int pagecount, double weight)
      Adds a hardback book with information including page count and weight to the book list.
      Parameters:
      book - The book object containing basic information (title, ISBN).
      bookid - The unique identifier of the book.
      bookType - The type of the book (e.g., Regular, HardBack, EBook, AudioBook).
      pagecount - The number of pages in the hardback book.
      weight - The weight of the hardback book in kilograms.
    • addHardBack

      public void addHardBack(Book book, int bookid, String bookType, String coverType, int pageCount, double weightKG)
      Adds a hardback book with complete information to the book list.
      Parameters:
      book - The book object containing complete information (title, author, ISBN, genre, etc.).
      bookid - The unique identifier of the book.
      bookType - The type of the book (e.g., Regular, HardBack, EBook, AudioBook).
      coverType - The type of cover (e.g., leather, cloth).
      pageCount - The number of pages in the hardback book.
      weightKG - The weight of the hardback book in kilograms.
    • addEBook

      public void addEBook(Book book, int bookid, String bookType, String fileFormat, double fileSize)
      Adds an E-Book to the book list.
      Parameters:
      book - The book object to add.
      bookid - The unique identifier of the book.
      bookType - The type of the book (e.g., "EBook").
      fileFormat - The format of the E-Book file.
      fileSize - The size of the E-Book file in megabytes.
    • addEBook

      public void addEBook(Book book, int bookid, String bookType, String fileFormat)
      Adds an E-Book to the book list with basic information.
      Parameters:
      book - The book object to add.
      bookid - The unique identifier of the book.
      bookType - The type of the book (e.g., "EBook").
      fileFormat - The format of the E-Book file.
    • addAudioBook

      public void addAudioBook(Book book, int bookid, String bookType, String fileFormat, double fileSize, String audioFormat, String bitrate)
      Adds an AudioBook to the book list with complete information.
      Parameters:
      book - The book object to add.
      bookid - The unique identifier of the book.
      bookType - The type of the book (e.g., "AudioBook").
      fileFormat - The format of the audio book file.
      fileSize - The size of the audio book file in megabytes.
      audioFormat - The format of the audio in the book (e.g., MP3, AAC).
      bitrate - The bitrate of the audio file.
    • addAudioBook

      public void addAudioBook(Book book, int bookid, String bookType, String fileFormat, String audioFormat, String bitrate)
      Adds an AudioBook to the book list with basic information and no file size specified.
      Parameters:
      book - The book object to add.
      bookid - The unique identifier of the book.
      bookType - The type of the book (e.g., "AudioBook").
      fileFormat - The format of the audio book file.
      audioFormat - The format of the audio in the book (e.g., MP3, AAC).
      bitrate - The bitrate of the audio file.
    • findBook

      public Optional<Book> findBook(ArrayList<Book> bookList, int id)
      Finds a book in the provided list by its ID.
      Parameters:
      bookList - The list of books to search within.
      id - The ID of the book to find.
      Returns:
      An Optional containing the found Book, or empty if no book with the specified ID is found.
    • removeBookById

      public void removeBookById(ArrayList<Book> bookList)
      Removes a book from the list by its ID after prompting the user to enter the ID.
      Parameters:
      bookList - The list of books from which the book will be removed.
    • searchBook

      public void searchBook(ArrayList<Book> bookList)
      Searches for books in the provided list based on user input criteria (Title, Author, ISBN, Genre, Publisher, Language). Prints the matching books or returns to the main menu based on user selection.
      Parameters:
      bookList - The list of books to search within.
    • retrieveBooks

      public static void retrieveBooks(ArrayList<Book> bookList)
      Displays a paginated catalog of books from the provided list. Allows navigation through pages and returns to the main menu upon user input.
      Parameters:
      bookList - The list of books to display.
    • viewBook

      public static void viewBook(ArrayList<Book> bookList)
      Displays detailed information about a specific book from the provided list based on user input.
      Parameters:
      bookList - The list of books to search for the specific book.