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 booleandoneprotected Object[]idsprotected booleanisStartprotected Supplier<Iterator<E>>iteratorSupplierprotected Parametersparametersprotected 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 voidaddIds(Object... newIds)voidclearIds()voidclose()Attempts to close an underlying iterator if it is of typeCloseableIterator.voidconfigure(Object... keyValues)Accept a configuration to theStep.voidconvertElementsToIds()Object[]getIds()ParametersgetParameters()Gets the parameters on the step.Class<E>getReturnClass()inthashCode()booleanisStartStep()static booleanisStartStep(Step<?,?> step)voidonGraphComputer()The 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>processNextStart()voidreset()Reset the state of the step such that it has no incoming starts.booleanreturnsEdge()booleanreturnsVertex()voidsetIteratorSupplier(Supplier<Iterator<E>> iteratorSupplier)StringtoString()-
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:ParameterizingGets the parameters on the step.- Specified by:
getParametersin interfaceParameterizing
-
configure
public void configure(Object... keyValues)
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
-
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:GraphComputingThe step will be executing on aGraphComputer.- Specified by:
onGraphComputerin interfaceGraphComputing
-
convertElementsToIds
public void convertElementsToIds()
-
processNextStart
protected Traverser.Admin<E> 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>
-
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
-
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- TheHasContainerto check for id validation.- Returns:
- true if the
HasContainerupdated ids and thus, was processed.
-
-