private boolean isClubBook(Book book) { boolean isClubBook = false; if (getNumberOfBooks() > 0) { for (Book clubBook : clubBooks) { if (clubBook.getIsbnNumber().equals(book.getIsbnNumber())) isClubBook = true; } } return isClubBook; }
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()); }
private boolean isBookBorrowed(Book book) { return borrowedBooks.containsKey(book.getIsbnNumber()); }