Package org.apache.commons.collections4.iterators

# 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>`

public class UniqueFilterIterator<E> extends FilterIterator<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

  Constructors
  Constructor
  Description
  `UniqueFilterIterator(Iterator<? extends E> iterator)`
  Constructs a new `UniqueFilterIterator`.

- ## 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

    public UniqueFilterIterator(Iterator<? extends E> iterator)
    Constructs a new `UniqueFilterIterator`.
    Parameters:
      `iterator` - the iterator to use