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>

- All Implemented Interfaces:
    Iterator<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 and 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`

- - ### Constructor Detail

    - #### UniqueFilterIterator

          public UniqueFilterIterator(Iterator<? extends E> iterator)

      Constructs a new `UniqueFilterIterator`.
      Parameters:
        `iterator` - the iterator to use

Copyright © 2001–2019 The Apache Software Foundation. All rights reserved.