Class AbstractStep<S,E>
java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep<S,E>
- All Implemented Interfaces:
Serializable,Cloneable,Iterator<Traverser.Admin<E>>,Step<S,E>
- Direct Known Subclasses:
AddEdgeStartStep,AddVertexStartStep,AggregateStep,CallStep,CallStepPlaceholder,CollectingBarrierStep,ComputerAwareStep,ComputerAwareStep.EndStep,ComputerResultStep,DeclarativeMatchStep,FilterStep,FlatMapStep,GraphStep,GraphStepPlaceholder,HasNextStep,IdentityStep,IoStep,LocalStep,MapStep,MatchStep.MatchStartStep,NoOpBarrierStep,OptionalStep,ProfileStep,ReducingBarrierStep,RemoteStep,RequirementsStep,SackValueStep,SideEffectBarrierStep,SideEffectStep,StartStep,SupplyingBarrierStep,TailGlobalStep,TailGlobalStepPlaceholder,TinkerCountGlobalStep,VertexProgramStep
- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Traverser.Admin<E>protected ExpandableStepIterator<S>protected Traversal.Adminprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a label to this step.voidaddStart(Traverser.Admin<S> start) Add a singleTraverser.Adminto the step.voidaddStarts(Iterator<Traverser.Admin<S>> starts) Add an iterator ofTraverser.Adminobjects of type S to the step.voidRemoves all labels on the step.clone()Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.booleangetId()Get the unique id of this step.Get the labels of this step.Get the next step to the current step.Get the step prior to the current step.<A,B> Traversal.Admin<A, B> Get theTraversal.Adminthat this step is contained within.inthashCode()booleanhasNext()booleanDetermines if starts objects are present without iterating forward.booleannext()protected Traverser.Admin<E>prepareTraversalForNextStep(Traverser.Admin<E> traverser) protected abstract Traverser.Admin<E>voidremoveLabel(String label) Remove a label from this step.voidreset()Reset the state of the step such that it has no incoming starts.voidGet the unique id of the step.voidsetNextStep(Step<E, ?> step) Set the step that is next to the current step.voidsetPreviousStep(Step<?, S> step) Set the step that is previous to the current step.voidsetTraversal(Traversal.Admin<?, ?> traversal) Set theTraversalthat this step is contained within.toString()Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, removeMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Step
equals, getRequirements
-
Field Details
-
labels
-
id
-
traversal
-
starts
-
nextEnd
-
traverserStepIdAndLabelsSetByChild
protected boolean traverserStepIdAndLabelsSetByChild -
previousStep
-
nextStep
-
-
Constructor Details
-
AbstractStep
-
-
Method Details
-
setId
Description copied from interface:StepGet the unique id of the step. These ids can change when strategies are applied and anonymous traversals are embedded in the parent traversal. A developer should typically not need to call this method. -
getId
Description copied from interface:StepGet the unique id of this step. -
addLabel
Description copied from interface:StepAdd a label to this step. -
removeLabel
Description copied from interface:StepRemove a label from this step.- Specified by:
removeLabelin interfaceStep<S,E> - Parameters:
label- the label to remove from this step
-
clearLabels
public void clearLabels()Description copied from interface:StepRemoves all labels on the step.- Specified by:
clearLabelsin interfaceStep<S,E>
-
getLabels
Description copied from interface:StepGet the labels of this step. The labels are ordered by the order of the calls toStep.addLabel(java.lang.String). -
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. -
addStarts
Description copied from interface:StepAdd an iterator ofTraverser.Adminobjects of type S to the step. -
addStart
Description copied from interface:StepAdd a singleTraverser.Adminto the step. -
hasStarts
public boolean hasStarts()Description copied from interface:StepDetermines if starts objects are present without iterating forward. This function has special applicability aroundReducingBarrierStepimplementations where they always returntruefor calls toIterator.hasNext(). Using this function gives insight to what the step itself is holding in its iterator without performing any sort of processing on the step itself. -
setPreviousStep
Description copied from interface:StepSet the step that is previous to the current step. Used for linking steps together to form a function chain.- Specified by:
setPreviousStepin interfaceStep<S,E> - Parameters:
step- the previous step of this step
-
getPreviousStep
Description copied from interface:StepGet the step prior to the current step.- Specified by:
getPreviousStepin interfaceStep<S,E> - Returns:
- The previous step
-
setNextStep
Description copied from interface:StepSet the step that is next to the current step. Used for linking steps together to form a function chain.- Specified by:
setNextStepin interfaceStep<S,E> - Parameters:
step- the next step of this step
-
getNextStep
Description copied from interface:StepGet the next step to the current step.- Specified by:
getNextStepin interfaceStep<S,E> - Returns:
- The next step
-
next
-
hasNext
public boolean hasNext() -
getTraversal
Description copied from interface:StepGet theTraversal.Adminthat this step is contained within.- Specified by:
getTraversalin interfaceStep<S,E> - Type Parameters:
A- The incoming object type of the traversalB- The outgoing object type of the traversal- Returns:
- The traversal of this step
-
setTraversal
Description copied from interface:StepSet theTraversalthat this step is contained within.- Specified by:
setTraversalin interfaceStep<S,E> - Parameters:
traversal- the new traversal for this step
-
processNextStart
- Throws:
NoSuchElementException
-
toString
-
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. -
equals
-
hashCode
public int hashCode() -
getStarts
-
isTraverserStepIdAndLabelsSetByChild
public boolean isTraverserStepIdAndLabelsSetByChild() -
prepareTraversalForNextStep
-