Class RepeatStep<S>
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep<S,E>
-
- org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep<S,S>
-
- org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep<S>
-
- All Implemented Interfaces:
Serializable
,AutoCloseable
,Cloneable
,Iterator<Traverser.Admin<S>>
,Step<S,S>
,GraphComputing
,TraversalParent
public final class RepeatStep<S> extends ComputerAwareStep<S,S> implements TraversalParent
- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RepeatStep.RepeatEndStep<S>
-
Nested classes/interfaces inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep
ComputerAwareStep.EndStep<S>
-
-
Field Summary
Fields Modifier and Type Field Description boolean
emitFirst
boolean
untilFirst
-
Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
id, labels, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdAndLabelsSetByChild
-
-
Constructor Summary
Constructors Constructor Description RepeatStep(Traversal.Admin traversal)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <A,B,C extends Traversal<A,B>>
CaddEmitToTraversal(C traversal, Traversal.Admin<B,?> emitPredicate)
static <A,B,C extends Traversal<A,B>>
CaddRepeatToTraversal(C traversal, String loopName, Traversal.Admin<B,B> repeatTraversal)
static <A,B,C extends Traversal<A,B>>
CaddRepeatToTraversal(C traversal, Traversal.Admin<B,B> repeatTraversal)
static <A,B,C extends Traversal<A,B>>
CaddUntilToTraversal(C traversal, Traversal.Admin<B,?> untilPredicate)
RepeatStep<S>
clone()
Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.protected Iterator<Traverser.Admin<S>>
computerAlgorithm()
boolean
doEmit(Traverser.Admin<S> traverser, boolean emitFirst)
boolean
doUntil(Traverser.Admin<S> traverser, boolean utilFirst)
Traversal.Admin<S,?>
getEmitTraversal()
List<Traversal.Admin<S,S>>
getGlobalChildren()
List<Traversal.Admin<S,?>>
getLocalChildren()
Traversal.Admin<S,S>
getRepeatTraversal()
Set<TraverserRequirement>
getRequirements()
Provide the necessaryTraverserRequirement
that must be met by the traverser in order for the step to function properly.Traversal.Admin<S,?>
getUntilTraversal()
int
hashCode()
void
reset()
Reset the state of the step such that it has no incoming starts.void
setEmitTraversal(Traversal.Admin<S,?> emitTraversal)
void
setLoopName(String loopName)
void
setRepeatTraversal(Traversal.Admin<S,S> repeatTraversal)
void
setTraversal(Traversal.Admin<?,?> parentTraversal)
Set theTraversal
that this step is contained within.void
setUntilTraversal(Traversal.Admin<S,?> untilTraversal)
protected Iterator<Traverser.Admin<S>>
standardAlgorithm()
String
toString()
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep
onGraphComputer, processNextStart
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
addLabel, addStart, addStarts, clearLabels, equals, getId, getLabels, getNextStep, getPreviousStep, getStarts, getTraversal, hasNext, hasStarts, isTraverserStepIdAndLabelsSetByChild, next, prepareTraversalForNextStep, removeLabel, setId, setNextStep, setPreviousStep
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.GraphComputing
atMaster
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent
addGlobalChild, addLocalChild, asStep, close, getSelfAndChildRequirements, integrateChild, removeGlobalChild, removeLocalChild, replaceLocalChild
-
-
-
-
Constructor Detail
-
RepeatStep
public RepeatStep(Traversal.Admin traversal)
-
-
Method Detail
-
getRequirements
public Set<TraverserRequirement> getRequirements()
Description copied from interface:Step
Provide the necessaryTraverserRequirement
that must be met by the traverser in order for the step to function properly. The provided default implements returns an empty set.- Specified by:
getRequirements
in interfaceStep<S,S>
- Returns:
- the set of requirements
-
setRepeatTraversal
public void setRepeatTraversal(Traversal.Admin<S,S> repeatTraversal)
-
setLoopName
public void setLoopName(String loopName)
-
setUntilTraversal
public void setUntilTraversal(Traversal.Admin<S,?> untilTraversal)
-
getUntilTraversal
public Traversal.Admin<S,?> getUntilTraversal()
-
setEmitTraversal
public void setEmitTraversal(Traversal.Admin<S,?> emitTraversal)
-
getEmitTraversal
public Traversal.Admin<S,?> getEmitTraversal()
-
getRepeatTraversal
public Traversal.Admin<S,S> getRepeatTraversal()
-
getGlobalChildren
public List<Traversal.Admin<S,S>> getGlobalChildren()
- Specified by:
getGlobalChildren
in interfaceTraversalParent
-
getLocalChildren
public List<Traversal.Admin<S,?>> getLocalChildren()
- Specified by:
getLocalChildren
in interfaceTraversalParent
-
doUntil
public final boolean doUntil(Traverser.Admin<S> traverser, boolean utilFirst)
-
doEmit
public final boolean doEmit(Traverser.Admin<S> traverser, boolean emitFirst)
-
toString
public String toString()
- Overrides:
toString
in classAbstractStep<S,S>
-
reset
public void reset()
Description copied from interface:Step
Reset the state of the step such that it has no incoming starts. Internal states are to be reset, but any sideEffect data structures are not to be recreated.
-
clone
public RepeatStep<S> clone()
Description copied from interface:Step
Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication. When cloning a step, it is important that the steps, the cloned step is equivalent to the state of the step whenStep.reset()
is called. Moreover, the previous and next steps should be set toEmptyStep
.
-
setTraversal
public void setTraversal(Traversal.Admin<?,?> parentTraversal)
Description copied from interface:Step
Set theTraversal
that this step is contained within.- Specified by:
setTraversal
in interfaceStep<S,S>
- Overrides:
setTraversal
in classAbstractStep<S,S>
- Parameters:
parentTraversal
- the new traversal for this step
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractStep<S,S>
-
standardAlgorithm
protected Iterator<Traverser.Admin<S>> standardAlgorithm() throws NoSuchElementException
- Specified by:
standardAlgorithm
in classComputerAwareStep<S,S>
- Throws:
NoSuchElementException
-
computerAlgorithm
protected Iterator<Traverser.Admin<S>> computerAlgorithm() throws NoSuchElementException
- Specified by:
computerAlgorithm
in classComputerAwareStep<S,S>
- Throws:
NoSuchElementException
-
addRepeatToTraversal
public static <A,B,C extends Traversal<A,B>> C addRepeatToTraversal(C traversal, Traversal.Admin<B,B> repeatTraversal)
-
addRepeatToTraversal
public static <A,B,C extends Traversal<A,B>> C addRepeatToTraversal(C traversal, String loopName, Traversal.Admin<B,B> repeatTraversal)
-
addUntilToTraversal
public static <A,B,C extends Traversal<A,B>> C addUntilToTraversal(C traversal, Traversal.Admin<B,?> untilPredicate)
-
addEmitToTraversal
public static <A,B,C extends Traversal<A,B>> C addEmitToTraversal(C traversal, Traversal.Admin<B,?> emitPredicate)
-
-