Package eu.bandm.tools.util.java
Class Iterators.Pairwise<T>
java.lang.Object
eu.bandm.tools.util.java.Iterators.Pairwise<T>
- Enclosing class:
Iterators
Deprecated, for removal: This API element is subject to removal in a future version.
Visitor which performs the method
first(Object)
for the first element of an Iterable; afterwards the method
pairwise(Object,Object)
for each pair of adjacent elements,
and at last the method last(Object)
.
These all are performed by invoking process()
.-
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated, for removal: This API element is subject to removal in a future version.The iterator which drives the visiting order.protected T
Deprecated, for removal: This API element is subject to removal in a future version.Internal register for the precedingly visited item.protected final @Opt ListIterator
<T> Deprecated, for removal: This API element is subject to removal in a future version.Identic toit
iff the constructor wihtListIterator
has been called. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Deprecated, for removal: This API element is subject to removal in a future version.Constructor which does not assume the Iterator to be a ListIterator.protected
Deprecated, for removal: This API element is subject to removal in a future version.Constructor which does not assume the Iterator to be a ListIterator.protected
Deprecated, for removal: This API element is subject to removal in a future version.Constructor which assumes that the Iterator is a ListIterator.protected
Pairwise
(ListIterator<T> lit) Deprecated, for removal: This API element is subject to removal in a future version.Constructor which assumes that the Iterator is a ListIterator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated, for removal: This API element is subject to removal in a future version.Can be overridden by the user to visit the very first element before the first pair is visited bypairwise(Object,Object)
.void
Deprecated, for removal: This API element is subject to removal in a future version.Can be overridden by the user to visit the very last element after the last pair is visited bypairwise(Object,Object)
.abstract void
Deprecated, for removal: This API element is subject to removal in a future version.Must be overridden by the user to visit the define what to do with each pair of adjacent elements.void
process()
Deprecated, for removal: This API element is subject to removal in a future version.Central public service provision to visit all wlements in the order of the given (List-) Iterator, executingfirst(Object)
,pairwise(Object,Object)
, andlast(Object)
in this sequential order.
-
Field Details
-
it
Deprecated, for removal: This API element is subject to removal in a future version.The iterator which drives the visiting order. -
lit
Deprecated, for removal: This API element is subject to removal in a future version.Identic toit
iff the constructor wihtListIterator
has been called. Otherwise null. Can be used by payload code for remove operation, etc. -
last
Deprecated, for removal: This API element is subject to removal in a future version.Internal register for the precedingly visited item.
-
-
Constructor Details
-
Pairwise
Deprecated, for removal: This API element is subject to removal in a future version.Constructor which does not assume the Iterator to be a ListIterator. -
Pairwise
Deprecated, for removal: This API element is subject to removal in a future version.Constructor which assumes that the Iterator is a ListIterator. -
Pairwise
Deprecated, for removal: This API element is subject to removal in a future version.Constructor which assumes that the Iterator is a ListIterator. -
Pairwise
Deprecated, for removal: This API element is subject to removal in a future version.Constructor which does not assume the Iterator to be a ListIterator.
-
-
Method Details
-
first
Deprecated, for removal: This API element is subject to removal in a future version.Can be overridden by the user to visit the very first element before the first pair is visited bypairwise(Object,Object)
. -
last
Deprecated, for removal: This API element is subject to removal in a future version.Can be overridden by the user to visit the very last element after the last pair is visited bypairwise(Object,Object)
. -
pairwise
Deprecated, for removal: This API element is subject to removal in a future version.Must be overridden by the user to visit the define what to do with each pair of adjacent elements. These are visited in the sequential order of the underlying Iterator. On Execution, that has berformed aIterator.next()
, so that it "points" (e.g. with itsIterator.hasNext()
to the successor of the later of both visited elements. -
process
public void process()Deprecated, for removal: This API element is subject to removal in a future version.Central public service provision to visit all wlements in the order of the given (List-) Iterator, executingfirst(Object)
,pairwise(Object,Object)
, andlast(Object)
in this sequential order.
-
Iterators.forEachPair(java.util.Iterator<T>, java.util.function.BiConsumer<T, T>)
instead.