Package overit.geocall.util
Class FilteredIterator<T>
java.lang.Object
overit.geocall.util.FilteredIterator<T>
- Type Parameters:
T- The type of elements returned by this iterator
- All Implemented Interfaces:
Iterator
This class implements an
Iterator over a collection that iterates only on valid elements.
The method that checks the validity is custombizable.-
Field Details
-
_i
-
_cached
protected boolean _cached -
_cache
-
-
Constructor Details
-
FilteredIterator
Creates a FilteredIterator starting from theIteratorpassed as parameter- Parameters:
i- The iterator used for the creation of the FilteredIterator
-
-
Method Details
-
valid
-
hasNext
public boolean hasNext()Returnstrueif the FilteredIterator has more valid elements. The validity of the elements is verified with thevalid(java.lang.Object)method. The search for the valid element is performed only if it is not cached yet. -
next
Returns the next valid element in the iteration. The search for the valid element is performed only if it is not cached yet (for example by the methodhasNext()). -
remove
public void remove()
-