net.sf.jga.util
Class FindIterator<T>
public
class
FindIterator<T>
extends Object
implements Iterator<T>
Iterator that provides the ability to skip to the first/next element that
meets a particular criteria.
Copyright © 2003 David A. Hall
Author: David A. Hall
Method Summary |
boolean | findNext(UnaryFunctor<T,Boolean> filter)
Returns true if at least one instance remaining in the iteration yields
true when passed to the filter. |
boolean | hasNext()
Returns true if there is at least one instance remaining in the iteration.
|
T | next() |
void | remove() |
static <T> FindIterator<T> | wrapIfNecessary(Iterator<? extends T> base)
Creates a FindIterator to wrap the given iterator, if the given iterator
isn't already a FindIterator |
public FindIterator(Iterator<? extends
T> iter)
Returns true if at least one instance remaining in the iteration yields
true when passed to the filter. This operation can advance the base
iterator. It will not, however, advance the base iterator if it is called
multiple times in succession without having retrieved the value.
public boolean hasNext()
Returns true if there is at least one instance remaining in the iteration.
This operation can advance the base iterator. It will not, however,
advance the base iterator if it is called multiple times in succession
without having retrieved the value.
public void remove()
public static <
T>
FindIterator<
T> wrapIfNecessary(Iterator<? extends
T> base)
Creates a FindIterator to wrap the given iterator, if the given iterator
isn't already a FindIterator