Package org.dmfs.jems2.iterator
Class Clustered<T>
- java.lang.Object
-
- org.dmfs.jems2.iterator.BaseIterator<java.lang.Iterable<T>>
-
- org.dmfs.jems2.iterator.Clustered<T>
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Iterable<T>>
public final class Clustered<T> extends BaseIterator<java.lang.Iterable<T>>
AnIteratordecorator which clusters consecutive elements of anotherIteratorby the result of aComparator. Consecutive elements which compare to0go into the same cluster. The original order of the elements remains the same.Clustered(Comparator.naturalOrder(), [5, 5, 5, 3, 3, 4, 4, 4, 5, 5, 2, 2]) -> [ [5, 5, 5], [3, 3], [4, 4, 4], [5, 5], [2, 2] ]
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()java.lang.Iterable<T>next()-
Methods inherited from class org.dmfs.jems2.iterator.BaseIterator
equals, hashCode, remove
-
-