/** * Set the default Book. It must satisfy the filter. * * @param newBook * The version to use as default. */ public void setDefault(Book newBook) { if (filter.test(newBook)) { book = newBook; } }
/** * Find the next (if there is one) * * @return the next book */ private Book findNext() { while (it.hasNext()) { Book book = it.next(); if (filter == null || filter.test(book)) { return book; } } return null; }
for (Book doc : allDocuments) { BookFilter filter = DOCUMENT_TYPE_SPINNER_FILTERS[selectedDocumentFilterNo]; if (filter.test(doc) && doc.getLanguage().equals(lang)) { displayedDocuments.add(doc);