Class BranchStep<S,E,M>
java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep<S,E>
org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep<S,E>
org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchStep<S,E,M>
- All Implemented Interfaces:
Serializable,AutoCloseable,Cloneable,Iterator<Traverser.Admin<E>>,Step<S,,E> GraphComputing,PopContaining,TraversalOptionParent<M,,S, E> TraversalParent
- Direct Known Subclasses:
ChooseStep,UnionStep
public class BranchStep<S,E,M>
extends ComputerAwareStep<S,E>
implements TraversalOptionParent<M,S,E>
- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Daniel Kuppitz (http://gremlin.guru)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep
ComputerAwareStep.EndStep<S>Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.PopContaining
PopContaining.PopInstruction -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Traversal.Admin<S,M> protected booleanprotected List<org.javatuples.Pair<Traversal.Admin<M,?>, Traversal.Admin<S, E>>> Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
id, labels, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdAndLabelsSetByChild -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildOption(M pickToken, Traversal.Admin<S, E> traversalOption) protected voidapplyCurrentTraverser(Traverser.Admin<S> start) Choose the right traversal option to apply and seed those options with this traverser.BranchStep<S,E, M> clone()Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.protected Iterator<Traverser.Admin<E>>Gets a list of all "global" child traversals for this step.List<Traversal.Admin<?,?>> Gets a list of all "local" child traversals for this step.Provide the necessaryTraverserRequirementthat must be met by the traverser in order for the step to function properly.List<org.javatuples.Pair<Traversal.Admin<M,?>, Traversal.Admin<S, E>>> inthashCode()protected List<Traversal.Admin<S,E>> pickBranches(M choice) voidreset()Reset the state of the step such that it has no incoming starts.voidsetBranchTraversal(Traversal.Admin<S, M> branchTraversal) voidsetTraversal(Traversal.Admin<?, ?> parentTraversal) Set theTraversalthat this step is contained within.protected Iterator<Traverser.Admin<E>>toString()Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep
onGraphComputer, processNextStartMethods 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, setPreviousStepMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.GraphComputing
atMasterMethods inherited from interface java.util.Iterator
forEachRemaining, removeMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent
addGlobalChild, addLocalChild, asStep, close, getPopInstructions, getSelfAndChildRequirements, integrateChild, removeGlobalChild, removeLocalChild, replaceLocalChild
-
Field Details
-
branchTraversal
-
traversalPickOptions
-
traversalOptions
-
hasBarrier
protected boolean hasBarrier
-
-
Constructor Details
-
BranchStep
-
-
Method Details
-
setBranchTraversal
-
addChildOption
Description copied from interface:TraversalOptionParentThe child as defined by the token it takes, likePickorMerge. This traversal may be of local or global scope depending on the step implementation that works withoption().- Specified by:
addChildOptionin interfaceTraversalOptionParent<S,E, M>
-
getTraversalOptions
-
getTraversalPickOptions
-
getBranchTraversal
-
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,E> - Returns:
- the set of requirements
-
getGlobalChildren
Description copied from interface:TraversalParentGets a list of all "global" child traversals for this step. A "global" traversal is one which evaluates across all of its parents incoming traversers at once. This is typically used in cases where the child traversal represents a branch of traversal flow. SeeBranchStepas an example.- Specified by:
getGlobalChildrenin interfaceTraversalParent
-
getLocalChildren
Description copied from interface:TraversalParentGets a list of all "local" child traversals for this step. A "local" traversal is one which is evaluated independently for each incoming traverser to the parent step. This is typically used in cases where the child is used to process or augment each traverser individually. SeeLocalSteporByModulatingas examples.- Specified by:
getLocalChildrenin interfaceTraversalParent
-
standardAlgorithm
- Specified by:
standardAlgorithmin classComputerAwareStep<S,E>
-
applyCurrentTraverser
Choose the right traversal option to apply and seed those options with this traverser. -
computerAlgorithm
- Specified by:
computerAlgorithmin classComputerAwareStep<S,E>
-
pickBranches
-
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
Description copied from interface:StepSet theTraversalthat this step is contained within.- Specified by:
setTraversalin interfaceStep<S,E> - Overrides:
setTraversalin classAbstractStep<S,E> - Parameters:
parentTraversal- the new traversal for this step
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractStep<S,E>
-
toString
- Overrides:
toStringin classAbstractStep<S,E>
-
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.
-