This assignment is designed to reinforce your understanding of arrays, Regex, loops, and Java, in general.
It asks you to build a Library Card Catalog class capable of holding an unknown number of cards. The Card Catalog has a few simple behaviors, which are described below. It also asks you to develop a Menu class which should contain the main() method and provide the user with a menu allowing the user to exercise all of the features of the Card Catalog class.
The Card Class
Each Card should have the following information about the book it describes.
- The constructor should take a three parameters, the title of the book, the author of the book, and the subject of the book.
- Users should be able to access all the fields of the Card.
The Card Catalog Class
Each Card Catalog should allow the user to store Cards. The user can add, remove, and access books as described below. Also note that the array should GROW when the array is full!
- The constructor should instantiate three seperate arrays, one to hold the cards in order by title, one to hold the cards in order by author, and one to hold the cards in order by subject The arrays should start at a size of 10.
- Users should be able to addACard() to the catalog and the cards should be filed in the correct order inside of the arrays based on the correct field.
- Users should be able to getATitle() by specifying the book's title (a String). This should be done using a binary search. This method should return the first Card with a title that matches the given title.
- Users should be able to getAnAuthor() by specifying a specific author. The method should return all the books written by this author.
- Users should be able to getSubject() which should return a list which contains all the books that involve this subject. This should be implemented using regex to search for the books.
- Users should be able to removeATitle() which should remove this books from ALL of the card catalog stacks.
- Users should be able to printTheCatalog() which should neatly print out all of the books in order by either title, or author, or subject based on how the user wants it.
The Menu Class
The menu should provide the user with the option of creating a new Card Catalog, and then of adding, removing indididual books, or of printing a list of all books within the Card Catalog.