Class GraphStep<S,E extends Element>
java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep<S,E>
org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep<S,E>
- All Implemented Interfaces:
Serializable,AutoCloseable,Cloneable,Iterator<Traverser.Admin<E>>,Step<S,,E> Configuring,GraphComputing,GraphStepContract<S,,E> Parameterizing,PopContaining,ReadOnlyTraversalParent,TraversalParent
- Direct Known Subclasses:
TinkerGraphStep
public class GraphStep<S,E extends Element>
extends AbstractStep<S,E>
implements GraphStepContract<S,E>, ReadOnlyTraversalParent
- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Pieter Martin
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.PopContaining
PopContaining.PopInstruction -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Object[]protected booleanprotected ParametersFields inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
id, labels, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdAndLabelsSetByChildFields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStepContract
CONCRETE_STEPS -
Constructor Summary
ConstructorsConstructorDescriptionGraphStep(Traversal.Admin traversal, Class<E> returnClass, boolean isStart, Object... ids) GraphStep(Traversal.Admin traversal, Class<E> returnClass, boolean isStart, Traversal.Admin<?, ?> idTraversal) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclearIds()clone()Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.voidclose()Attempts to close an underlying iterator if it is of typeCloseableIterator.voidAccept a configuration to theStep.voidObject[]getIds()Traversal.Admin<?,?> Returns the child traversal used to resolve element IDs, ornullif literal IDs are used.<S,E> List<Traversal.Admin<S, E>> Gets a list of all "local" child traversals for this step.Gets the parameters on the step.inthashCode()booleanstatic booleanisStartStep(Step<?, ?> step) voidThe step will be executing on aGraphComputer.static booleanprocessHasContainerIds(GraphStep<?, ?> graphStep, HasContainer hasContainer) Helper method for providers that want to "fold in"HasContainer's based on id checking into the ids of theGraphStep.protected Traverser.Admin<E>voidreset()Reset the state of the step such that it has no incoming starts.booleanbooleanvoidsetIdTraversal(Traversal.Admin<?, ?> idTraversal) Sets the child traversal used to resolve element IDs.voidsetIteratorSupplier(Supplier<Iterator<E>> iteratorSupplier) voidsetTraversal(Traversal.Admin<?, ?> parentTraversal) Set theTraversalthat this step is contained within.toString()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, 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 org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStepContract
getIdsAsGValuesMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, removeMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Step
addLabel, addStart, addStarts, clearLabels, equals, getId, getLabels, getNextStep, getPreviousStep, getRequirements, getTraversal, hasStarts, removeLabel, setId, setNextStep, setPreviousStepMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent
addGlobalChild, addLocalChild, asStep, getGlobalChildren, getPopInstructions, getSelfAndChildRequirements, integrateChild, removeGlobalChild, removeLocalChild, replaceLocalChild
-
Field Details
-
parameters
-
returnClass
-
ids
-
iteratorSupplier
-
isStart
protected boolean isStart -
done
protected boolean done
-
-
Constructor Details
-
GraphStep
-
GraphStep
public GraphStep(Traversal.Admin traversal, Class<E> returnClass, boolean isStart, Traversal.Admin<?, ?> idTraversal)
-
-
Method Details
-
getIdTraversal
Returns the child traversal used to resolve element IDs, ornullif literal IDs are used. -
setIdTraversal
Sets the child traversal used to resolve element IDs. CallsTraversalParent.integrateChild(Traversal.Admin)on the provided traversal. -
toString
- Overrides:
toStringin classAbstractStep<S,E extends Element>
-
getParameters
Description copied from interface:ParameterizingGets the parameters on the step.- Specified by:
getParametersin interfaceParameterizing
-
configure
Description copied from interface:ConfiguringAccept a configuration to theStep. Note that this interface extendsParameterizingand so there is an expectation that theStepimplementation will have aParametersinstance that will house any values passed to this method. Storing these configurations inParametersis not a requirement however, IF the configuration is an expected option for the step and can be stored on a member field that can be accessed on the step by more direct means (i.e. like a getter method).- Specified by:
configurein interfaceConfiguring
-
getReturnClass
- Specified by:
getReturnClassin interfaceGraphStepContract<S,E extends Element>
-
isStartStep
public boolean isStartStep()- Specified by:
isStartStepin interfaceGraphStepContract<S,E extends Element>
-
isStartStep
-
returnsVertex
public boolean returnsVertex()- Specified by:
returnsVertexin interfaceGraphStepContract<S,E extends Element>
-
returnsEdge
public boolean returnsEdge()- Specified by:
returnsEdgein interfaceGraphStepContract<S,E extends Element>
-
setIteratorSupplier
-
getIds
- Specified by:
getIdsin interfaceGraphStepContract<S,E extends Element>
-
addIds
-
clearIds
public void clearIds()- Specified by:
clearIdsin interfaceGraphStepContract<S,E extends Element>
-
onGraphComputer
public void onGraphComputer()Description copied from interface:GraphComputingThe step will be executing on aGraphComputer.- Specified by:
onGraphComputerin interfaceGraphComputing
-
convertElementsToIds
public void convertElementsToIds() -
processNextStart
- Specified by:
processNextStartin classAbstractStep<S,E extends Element>
-
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. -
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractStep<S,E extends Element>
-
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
-
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 extends Element> - Overrides:
setTraversalin classAbstractStep<S,E extends Element> - Parameters:
parentTraversal- the new traversal for this step
-
close
public void close()Attempts to close an underlying iterator if it is of typeCloseableIterator. Graph providers may choose to return this interface containing their vertices and edges if there are expensive resources that might need to be released at some point.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceTraversalParent
-
processHasContainerIds
Helper method for providers that want to "fold in"HasContainer's based on id checking into the ids of theGraphStep.- Parameters:
graphStep- the GraphStep to potentiallyaddIds(Object...).hasContainer- TheHasContainerto check for id validation.- Returns:
- true if the
HasContainerupdated ids and thus, was processed.
-