public class SwappingIterator<T> extends ForwardPeekingMappingIterator<T,T>
Iterator that swaps any pair of items in the iteration that match the given predicate.hasNext, nextiterator| 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, removeprotected T mapFollowing(boolean hasFollowing, T following)
mapFollowing in class ForwardPeekingMappingIterator<T,T>