Package com.jahnreil_stratpoint
Class ManageBook
java.lang.Object
com.jahnreil_stratpoint.ManageBook
Manages a list of books and provides operations to manipulate them.
-
Constructor Summary
ConstructorDescriptionManageBook
(ArrayList<Book> bookList) Constructs a ManageBook object with an initial list of books. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Adds a book with basic information (title, ISBN) to the book list.void
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
Allows the user to add different types of books to the book list.void
Adds an E-Book to the book list with basic information.void
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.Finds a book in the provided list by its ID.void
removeBookById
(ArrayList<Book> bookList) Removes a book from the list by its ID after prompting the user to enter the ID.static void
retrieveBooks
(ArrayList<Book> bookList) Displays a paginated catalog of books from the provided list.void
searchBook
(ArrayList<Book> bookList) Searches for books in the provided list based on user input criteria (Title, Author, ISBN, Genre, Publisher, Language).static void
Displays detailed information about a specific book from the provided list based on user input.
-
Constructor Details
-
ManageBook
Constructs a ManageBook object with an initial list of books.- Parameters:
bookList
- The initial list of books to manage.
-
-
Method Details
-
addBook
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
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
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
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
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
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
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
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
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
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
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
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.
-