org.crosswire.jsword.book
Class BookFilterIterator

java.lang.Object
  extended by org.crosswire.jsword.book.BookFilterIterator
All Implemented Interfaces:
Iterable<Book>, Iterator<Book>

public class BookFilterIterator
extends Object
implements Iterable<Book>, Iterator<Book>

An iterator that filters as it goes.

Author:
Joe Walker [joe at eireneh dot com], DM Smith
See Also:
for license details.
The copyright to this program is held by it's authors.

Field Summary
private  BookFilter filter
          The value filter
private  Iterator<Book> it
           
private  Book next
          The stored next value
 
Constructor Summary
BookFilterIterator(List<Book> books, BookFilter filter)
          Simple ctor
 
Method Summary
private  Book findNext()
          Find the next (if there is one)
 boolean hasNext()
           
 Iterator<Book> iterator()
           
 Book next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next

private Book next
The stored next value


it

private Iterator<Book> it

filter

private BookFilter filter
The value filter

Constructor Detail

BookFilterIterator

public BookFilterIterator(List<Book> books,
                          BookFilter filter)
Simple ctor

Parameters:
filter - The filter to use, if null, will iterate over all values
Method Detail

iterator

public Iterator<Book> iterator()
Specified by:
iterator in interface Iterable<Book>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<Book>

next

public Book next()
Specified by:
next in interface Iterator<Book>

remove

public void remove()
Specified by:
remove in interface Iterator<Book>

findNext

private Book findNext()
Find the next (if there is one)


Copyright ? 2003-2011