public void removeAllBooksByList(List<Book> tmpBookList) { for (Book k : BookList) { for (Book tmpK : tmpBookList) { if (k.equals(tmpK)) { BookList.remove(k); } } } }
public List<Book> findAllBooksByAuthor(String author) { List<Book> results = new ArrayList<Book>(); for (Book k : BookList) { if (k.getAuthor().equals(author)) { results.add(k); } } return results; }
public List<Book> findAllBooksByName(String name) { List<Book> results = new ArrayList<Book>(); for (Book k : BookList) { if (k.getName().equals(name)) { results.add(k); } } return results; }
public Book hasBook(Book k) { for (Book q : BookList) { if (k.equals(q)) { return q; } } return null; }
public void renameAllBooksByAuthor(List<Book> bookList, String newAuthor) { for (Book k : bookList) { k.setName(newAuthor); } }
public void renameAllBooksByName(List<Book> bookList, String newName) { for (Book k : bookList) { k.setName(newName); } }
public void printBookList() { for (Book k : BookList) k.printBook(); }