S - The incoming object type of the stepE - The outgoing object type of the steppublic interface Step<S,E> extends java.util.Iterator<Traverser<E>>, java.lang.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(java.util.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.
|
java.lang.String |
getId()
Get the unique id of this step.
|
java.util.Optional<java.lang.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 java.util.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<A,B> |
getTraversal()
Get the
Traversal that this step is contained within. |
void |
reset()
Reset the state of the step such that it has no incoming starts.
|
void |
setId(java.lang.String id)
Get the unique id of the step.
|
void |
setLabel(java.lang.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<?,?> traversal)
Set the
Traversal that this step is contained within. |
void addStarts(java.util.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<A,B> getTraversal()
Traversal that this step is contained within.A - The incoming object type of the traversalB - The outgoing object type of the traversalvoid setTraversal(Traversal<?,?> traversal)
Traversal that this step is contained within.traversal - the new traversal for this stepvoid reset()
Step<S,E> clone() throws java.lang.CloneNotSupportedException
EmptyStep.java.lang.CloneNotSupportedExceptionjava.util.Optional<java.lang.String> getLabel()
Optional.empty() is returned.void setLabel(java.lang.String label)
label - the label for this stepvoid setId(java.lang.String id)
id - the unique id of the stepjava.lang.String getId()
default java.util.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 TinkerPop. All Rights Reserved.