S
- The incoming object type of the stepE
- The outgoing object type of the steppublic interface Step<S,E> extends Iterator<Traverser<E>>, Serializable, Cloneable
Step
denotes a unit of computation within a Traversal
.
A step takes an incoming object and yields an outgoing object.
Steps are chained together in a Traversal
to yield a lazy function chain of computation.
In the constructor of a Step, never store explicit sideEffect objects in TraversalSideEffects
.
If a sideEffect needs to be registered with the Traversal
, use SideEffects.registerSupplier().Modifier and Type | Method and Description |
---|---|
void |
addStart(Traverser<S> start)
Add a single
Traverser to the step. |
void |
addStarts(Iterator<Traverser<S>> starts)
Add a iterator of
Traverser objects of type S to the step. |
Step<S,E> |
clone()
Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.
|
String |
getId()
Get the unique id of this step.
|
Optional<String> |
getLabel()
Get the label of this step.
|
Step<E,?> |
getNextStep()
Get the next step to the current step.
|
Step<?,S> |
getPreviousStep()
Get the step prior to the current step.
|
default Set<TraverserRequirement> |
getRequirements()
Provide the necessary
TraverserRequirement that must be met by the traverser in order for the step to function properly. |
<A,B> Traversal.Admin<A,B> |
getTraversal()
Get the
Traversal.Admin that this step is contained within. |
void |
reset()
Reset the state of the step such that it has no incoming starts.
|
void |
setId(String id)
Get the unique id of the step.
|
void |
setLabel(String label)
Set the label of this step.
|
void |
setNextStep(Step<E,?> step)
Set the step that is next to the current step.
|
void |
setPreviousStep(Step<?,S> step)
Set the step that is previous to the current step.
|
void |
setTraversal(Traversal.Admin<?,?> traversal)
Set the
Traversal that this step is contained within. |
forEachRemaining, hasNext, next, remove
void addStarts(Iterator<Traverser<S>> starts)
Traverser
objects of type S to the step.starts
- The iterator of objects to addvoid addStart(Traverser<S> start)
Traverser
to the step.start
- The traverser to addvoid setPreviousStep(Step<?,S> step)
step
- the previous step of this stepStep<?,S> getPreviousStep()
void setNextStep(Step<E,?> step)
step
- the next step of this step<A,B> Traversal.Admin<A,B> getTraversal()
Traversal.Admin
that this step is contained within.A
- The incoming object type of the traversalB
- The outgoing object type of the traversalvoid setTraversal(Traversal.Admin<?,?> traversal)
Traversal
that this step is contained within.traversal
- the new traversal for this stepvoid reset()
Step<S,E> clone()
EmptyStep
.Optional<String> getLabel()
Optional.empty()
is returned.void setLabel(String label)
label
- the label for this stepvoid setId(String id)
id
- the unique id of the stepString getId()
default Set<TraverserRequirement> getRequirements()
TraverserRequirement
that must be met by the traverser in order for the step to function properly.
The provided default implements returns an empty set.Copyright © 2013–2015 Apache Software Foundation. All rights reserved.