public class SwappingIterator<T> extends ForwardPeekingMappingIterator<T,T>
Iterator
that swaps any pair of items in the iteration that match the given predicate.hasNext, next
iterator
Constructor and Description |
---|
SwappingIterator(java.util.Iterator<T> iterator,
java.util.function.BiPredicate<? super T,? super T> swapPredicate) |
Modifier and Type | Method and Description |
---|---|
protected T |
mapFollowing(boolean hasFollowing,
T following) |
protected T |
mapNext(T next,
T following) |
hasNext, next, remove
protected T mapFollowing(boolean hasFollowing, T following)
mapFollowing
in class ForwardPeekingMappingIterator<T,T>