Class UniqueFilterIterator<E>
java.lang.Object
org.apache.commons.collections4.iterators.FilterIterator<E>
org.apache.commons.collections4.iterators.UniqueFilterIterator<E>
- Type Parameters:
E
- the type of elements returned by this iterator.
- All Implemented Interfaces:
Iterator<E>
,IteratorOperations<E>
A FilterIterator which only returns "unique" Objects. Internally,
the Iterator maintains a Set of objects it has already encountered,
and duplicate Objects are skipped.
- Since:
- 2.1
-
Constructor Summary
ConstructorsConstructorDescriptionUniqueFilterIterator
(Iterator<? extends E> iterator) Constructs a newUniqueFilterIterator
. -
Method Summary
Methods inherited from class org.apache.commons.collections4.iterators.FilterIterator
getIterator, getPredicate, hasNext, next, remove, setIterator, setPredicate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
Methods inherited from interface org.apache.commons.collections4.iterators.IteratorOperations
addTo, removeNext, toCollection, toList, toSet
-
Constructor Details
-
UniqueFilterIterator
Constructs a newUniqueFilterIterator
.- Parameters:
iterator
- the iterator to use
-