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 classRepeatStep.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 booleanemitFirstbooleanuntilFirst-
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()booleandoEmit(Traverser.Admin<S> traverser, boolean emitFirst)booleandoUntil(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 necessaryTraverserRequirementthat must be met by the traverser in order for the step to function properly.Traversal.Admin<S,?>getUntilTraversal()inthashCode()voidreset()Reset the state of the step such that it has no incoming starts.voidsetEmitTraversal(Traversal.Admin<S,?> emitTraversal)voidsetLoopName(String loopName)voidsetRepeatTraversal(Traversal.Admin<S,S> repeatTraversal)voidsetTraversal(Traversal.Admin<?,?> parentTraversal)Set theTraversalthat this step is contained within.voidsetUntilTraversal(Traversal.Admin<S,?> untilTraversal)protected Iterator<Traverser.Admin<S>>standardAlgorithm()StringtoString()-
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:StepProvide the necessaryTraverserRequirementthat must be met by the traverser in order for the step to function properly. The provided default implements returns an empty set.- Specified by:
getRequirementsin 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:
getGlobalChildrenin interfaceTraversalParent
-
getLocalChildren
public List<Traversal.Admin<S,?>> getLocalChildren()
- Specified by:
getLocalChildrenin 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:
toStringin classAbstractStep<S,S>
-
reset
public void reset()
Description copied from interface:StepReset 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:StepCloning 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:StepSet theTraversalthat this step is contained within.- Specified by:
setTraversalin interfaceStep<S,S>- Overrides:
setTraversalin classAbstractStep<S,S>- Parameters:
parentTraversal- the new traversal for this step
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractStep<S,S>
-
standardAlgorithm
protected Iterator<Traverser.Admin<S>> standardAlgorithm() throws NoSuchElementException
- Specified by:
standardAlgorithmin classComputerAwareStep<S,S>- Throws:
NoSuchElementException
-
computerAlgorithm
protected Iterator<Traverser.Admin<S>> computerAlgorithm() throws NoSuchElementException
- Specified by:
computerAlgorithmin 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)
-
-