Package eu.bandm.tools.util.java
Class Iterators.Triplewise<T>
java.lang.Object
eu.bandm.tools.util.java.Iterators.Triplewise<T>
- Enclosing class:
- Iterators
Visitor which performs the method
action(Object,Object,Object)
for triples of adjacent elements of an Iterable.
The references wander through the positions, from the third to the first.
The schema for a four element list is as follows:
null null #0 null #0 #1 #0 #1 #2 #1 #2 #3 #2 #3 null #3 null null
-
Field Summary
Modifier and TypeFieldDescriptionevidenprotected T
The middle of the three visited instances (in the sequential order of the visitor).protected T
The first of the three visited instances (in the sequential order of the visitor).protected T
The last of the three visited instances (in the sequential order of the visitor). -
Constructor Summary
ModifierConstructorDescriptionprotected
Triplewise
(Iterable<T> it) evidentprotected
Triplewise
(Iterator<T> it) evident -
Method Summary
-
Field Details
-
it
eviden -
t
The last of the three visited instances (in the sequential order of the visitor). Will be the last parameter in the invocation ofaction(T, T, T)
. Will be ==null for the last two invocations, see the table above. -
last
The middle of the three visited instances (in the sequential order of the visitor). Will be the midle parameter in the invocations ofaction(T, T, T)
. Will be ==null for the first and the last invocation, see the table above. -
lastlast
The first of the three visited instances (in the sequential order of the visitor). Will be the first parameter in the invocations ofaction(T, T, T)
. Will be ==null for the first two invocation, see the table above.
-
-
Constructor Details
-
Triplewise
evident -
Triplewise
evident
-
-
Method Details
-
action
Call back to be overwritten by the user. Define here what to do on the invocations which follow the table above. -
visit
public void visit()Executes all the invocations of with the argument combinations described in the table above.
-