Package org.dmfs.jems2.iterator
Class Distinct<T>
- java.lang.Object
-
- org.dmfs.jems2.iterator.BaseIterator<E>
-
- org.dmfs.jems2.iterator.DelegatingIterator<T>
-
- org.dmfs.jems2.iterator.Distinct<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
public final class Distinct<T> extends DelegatingIterator<T>
AnIteratorwhich 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"]
-
-
Method Summary
-
Methods inherited from class org.dmfs.jems2.iterator.DelegatingIterator
hasNext, next
-
Methods inherited from class org.dmfs.jems2.iterator.BaseIterator
equals, hashCode, remove
-
-