Advertisement
Kimes

Untitled

Mar 29th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.25 KB | None | 0 0
  1. public void addBook(Book newAddbook) {
  2.         for (Book book : bookMap.values()) {
  3.             if (book.equals(newAddbook)) {
  4.                 book.addCopy();
  5.                 return;
  6.             }
  7.         }
  8.         Integer id = uniqueID++;
  9.         newAddbook.setId(id);
  10.         ;
  11.         bookMap.put(id, newAddbook);
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement