Class DistinctIterator<T>

java.lang.Object
org.cyclops.cyclopscore.datastructure.DistinctIterator<T>
Type Parameters:
T - The type to iterate over.
All Implemented Interfaces:
Iterator<T>

public class DistinctIterator<T> extends Object implements Iterator<T>
An iterator that wraps around another iterator and only outputs unique items.
  • Constructor Details

    • DistinctIterator

      public DistinctIterator(Iterator<T> it)
    • DistinctIterator

      public DistinctIterator(Iterator<T> it, boolean identity)
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<T>