Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void addBook(String title, String year, String author) {
- uniqueID++;
- for (Book book : bookMap.values()) {
- if (book.getTitle().equals(title) && (book.getYear().equals(year)) && (book.getAuthor().equals(author))) {
- numberOfCopies++;
- } else {
- Book newBook = new Book(title, year, author, uniqueID, numberOfCopies);
- bookMap.put(uniqueID, newBook);
- numberOfCopies = 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement