public void addMemberToBookRequest(Book book, Member member) { if (isClubMember(member) && isClubBook(book)) { String isbnNumber = book.getIsbnNumber(); if (isBookBorrowed(book)) { getBookRequest(book).addToQueue(member); } else { BookQueue bookQueue = new BookQueue(); bookQueue.addToQueue(member); borrowedBooks.put(isbnNumber, bookQueue); } } }
public int getBookRequestSize(Book book) { int numberOfBookRequest = 0; if (borrowedBooks.containsKey(book.getIsbnNumber())) numberOfBookRequest = borrowedBooks.get(book.getIsbnNumber()).getSizeOfQueue(); return numberOfBookRequest; }
private BookQueue getBookRequest(Book book) { return borrowedBooks.get(book.getIsbnNumber()); }
public int getNumberOfBorrowedBooks() { return borrowedBooks.size(); }
private boolean isBookBorrowed(Book book) { return borrowedBooks.containsKey(book.getIsbnNumber()); }