Class Distinct<T>

  • All Implemented Interfaces:
    java.lang.Iterable<T>

    public final class Distinct<T>
    extends DelegatingIterable<T>
    An Iterator which drops duplicates of already iterated elements.

    Examples

     Distinct([1, 2, 2, 1, 2, 3, 3]) ->
     [1, 2, 3]
    
     Distinct(String::length, ["abc", "xyz", "42", "21"]) ->
     ["abc", "42"]
     
    • Constructor Summary

      Constructors 
      Constructor Description
      Distinct​(java.lang.Iterable<T> delegate)  
      Distinct​(Function<? super T,​? extends V> criterionFunction, java.lang.Iterable<T> delegate)  
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • Distinct

        public Distinct​(java.lang.Iterable<T> delegate)
      • Distinct

        public Distinct​(Function<? super T,​? extends V> criterionFunction,
                        java.lang.Iterable<T> delegate)