public TBook search_accessible_book(Object data) { Iterator<TBook> it1 = mBooks.iterator(); TBook helpbook; while (it1.hasNext()) { helpbook = it1.next(); if (helpbook.period_pass(data)) { return helpbook; } } return null; }
public void add_book(String[] data) { TFactory factory = new TFactory(); TBook newbook = factory.create_book(data); if (search_book(newbook) == null) mBooks.add(newbook); newbook.setmTitle_book(this); }