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
,Parameterizing
- Direct Known Subclasses:
TinkerGraphStep
public class GraphStep<S,E extends Element> extends AbstractStep<S,E> implements GraphComputing, AutoCloseable, Configuring
- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Pieter Martin
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
done
protected Object[]
ids
protected boolean
isStart
protected Supplier<Iterator<E>>
iteratorSupplier
protected Parameters
parameters
protected Class<E>
returnClass
-
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 GraphStep(Traversal.Admin traversal, Class<E> returnClass, boolean isStart, Object... ids)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIds(Object... newIds)
void
clearIds()
void
close()
Attempts to close an underlying iterator if it is of typeCloseableIterator
.void
configure(Object... keyValues)
Accept a configuration to theStep
.void
convertElementsToIds()
Object[]
getIds()
Parameters
getParameters()
Gets the parameters on the step.Class<E>
getReturnClass()
int
hashCode()
boolean
isStartStep()
static boolean
isStartStep(Step<?,?> step)
void
onGraphComputer()
The step will be executing on aGraphComputer
.static boolean
processHasContainerIds(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>
processNextStart()
void
reset()
Reset the state of the step such that it has no incoming starts.boolean
returnsEdge()
boolean
returnsVertex()
void
setIteratorSupplier(Supplier<Iterator<E>> iteratorSupplier)
String
toString()
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
addLabel, addStart, addStarts, clearLabels, clone, equals, getId, getLabels, getNextStep, getPreviousStep, getStarts, getTraversal, hasNext, hasStarts, isTraverserStepIdAndLabelsSetByChild, next, prepareTraversalForNextStep, removeLabel, setId, setNextStep, setPreviousStep, setTraversal
-
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
equals, getRequirements
-
-
-
-
Field Detail
-
parameters
protected Parameters parameters
-
ids
protected Object[] ids
-
isStart
protected boolean isStart
-
done
protected boolean done
-
-
Constructor Detail
-
GraphStep
public GraphStep(Traversal.Admin traversal, Class<E> returnClass, boolean isStart, Object... ids)
-
-
Method Detail
-
getParameters
public Parameters getParameters()
Description copied from interface:Parameterizing
Gets the parameters on the step.- Specified by:
getParameters
in interfaceParameterizing
-
configure
public void configure(Object... keyValues)
Description copied from interface:Configuring
Accept a configuration to theStep
. Note that this interface extendsParameterizing
and so there is an expectation that theStep
implementation will have aParameters
instance that will house any values passed to this method. Storing these configurations inParameters
is 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:
configure
in interfaceConfiguring
-
isStartStep
public boolean isStartStep()
-
isStartStep
public static boolean isStartStep(Step<?,?> step)
-
returnsVertex
public boolean returnsVertex()
-
returnsEdge
public boolean returnsEdge()
-
getIds
public Object[] getIds()
-
addIds
public void addIds(Object... newIds)
-
clearIds
public void clearIds()
-
onGraphComputer
public void onGraphComputer()
Description copied from interface:GraphComputing
The step will be executing on aGraphComputer
.- Specified by:
onGraphComputer
in interfaceGraphComputing
-
convertElementsToIds
public void convertElementsToIds()
-
processNextStart
protected Traverser.Admin<E> processNextStart()
- Specified by:
processNextStart
in classAbstractStep<S,E extends Element>
-
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.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractStep<S,E extends Element>
-
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:
close
in interfaceAutoCloseable
-
processHasContainerIds
public static boolean processHasContainerIds(GraphStep<?,?> graphStep, HasContainer hasContainer)
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
- TheHasContainer
to check for id validation.- Returns:
- true if the
HasContainer
updated ids and thus, was processed.
-
-