Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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);
     }
   }
 }
Ejemplo n.º 3
0
 public int getBookRequestSize(Book book) {
   int numberOfBookRequest = 0;
   if (borrowedBooks.containsKey(book.getIsbnNumber()))
     numberOfBookRequest = borrowedBooks.get(book.getIsbnNumber()).getSizeOfQueue();
   return numberOfBookRequest;
 }
Ejemplo n.º 4
0
 public void setBookCopies(Book book, int numberofcopies) {
   book.setBookCopies(numberofcopies);
 }
Ejemplo n.º 5
0
 private void incrementBookCopies(Book book) {
   book.incrementBookCopies();
 }
Ejemplo n.º 6
0
 private void decrementBookCopies(Book book) {
   book.decrementBookCopies();
 }
Ejemplo n.º 7
0
 private BookQueue getBookRequest(Book book) {
   return borrowedBooks.get(book.getIsbnNumber());
 }
Ejemplo n.º 8
0
 private boolean isBookBorrowed(Book book) {
   return borrowedBooks.containsKey(book.getIsbnNumber());
 }