org.springmodules.validation.util.collection
Class FilteredIterator
java.lang.Object
org.springmodules.validation.util.collection.ReadOnlyIterator
org.springmodules.validation.util.collection.FilteredIterator
- All Implemented Interfaces:
- java.util.Iterator
- Direct Known Subclasses:
- SubElementsIterator
public class FilteredIterator
- extends ReadOnlyIterator
An wrapper iterator that filters out items from the underlying iterator based on a condition.
- Author:
- Uri Boness
|
Constructor Summary |
FilteredIterator(java.util.Iterator iterator,
Condition condition)
Constructs a new FilteredIterator with given iterator to wrap and a condition. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FilteredIterator
public FilteredIterator(java.util.Iterator iterator,
Condition condition)
- Constructs a new FilteredIterator with given iterator to wrap and a condition. The constructed iterator will
return only the element that adhere to the given condition.
- Parameters:
iterator - The iterator to wrap.condition - The condition that determines what elements should be returned by this iterator.
hasNext
public boolean hasNext()
next
public java.lang.Object next()
initializeIfNeeded
protected void initializeIfNeeded()
advanceIterator
protected void advanceIterator()
Copyright © 2005. All Rights Reserved.