MCPcopy
hub / github.com/careercup/ctci / addBook

Method addBook

java/Chapter 8/Question8_5/Library.java:9–16  ·  view source on GitHub ↗
(int id, String details)

Source from the content-addressed store, hash-verified

7 private Hashtable<Integer, Book> books;
8
9 public Book addBook(int id, String details) {
10 if (books.containsKey(id)) {
11 return null;
12 }
13 Book book = new Book(id, details);
14 books.put(id, book);
15 return book;
16 }
17
18 public boolean remove(Book b){
19 return remove(b.getID());

Callers

nothing calls this directly

Calls 1

putMethod · 0.80

Tested by

no test coverage detected