public final class SelectStep<S,E> extends MapStep<S,Map<String,E>> implements Scoping, TraversalParent, PathProcessor, ByModulating
Scoping.KeyNotFoundException, Scoping.Variable
PathProcessor.ElementRequirement
id, labels, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdAndLabelsSetByChild
Constructor and Description |
---|
SelectStep(Traversal.Admin traversal,
Pop pop,
String... selectKeys) |
Modifier and Type | Method and Description |
---|---|
SelectStep<S,E> |
clone()
Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.
|
Map<String,Traversal.Admin<Object,E>> |
getByTraversals() |
Set<String> |
getKeepLabels() |
List<Traversal.Admin<Object,E>> |
getLocalChildren() |
Pop |
getPop() |
Set<TraverserRequirement> |
getRequirements()
Provide the necessary
TraverserRequirement that must be met by the traverser in order for the step to
function properly. |
Set<String> |
getScopeKeys()
Get the labels that this scoping step will access during the traversal
|
List<String> |
getSelectKeys()
Get the keys for this SelectStep.
|
int |
hashCode() |
void |
modulateBy(Traversal.Admin<?,?> selectTraversal) |
protected Traverser.Admin<Map<String,E>> |
processNextStart() |
void |
replaceLocalChild(Traversal.Admin<?,?> oldTraversal,
Traversal.Admin<?,?> newTraversal) |
void |
reset()
Reset the state of the step such that it has no incoming starts.
|
void |
setKeepLabels(Set<String> keepLabels) |
void |
setTraversal(Traversal.Admin<?,?> parentTraversal)
Set the
Traversal that this step is contained within. |
String |
toString() |
addLabel, addStart, addStarts, equals, getId, getLabels, getNextStep, getPreviousStep, getStarts, getTraversal, hasNext, hasStarts, isTraverserStepIdAndLabelsSetByChild, next, prepareTraversalForNextStep, removeLabel, setId, setNextStep, setPreviousStep
finalize, getClass, notify, notifyAll, wait, wait, wait
getNullableScopeValue, getSafeScopeValue, getScopeValue
addGlobalChild, addLocalChild, asStep, close, getGlobalChildren, getSelfAndChildRequirements, integrateChild, removeGlobalChild, removeLocalChild
getMaxRequirement, processTraverserPathLabels
modulateBy, modulateBy, modulateBy, modulateBy, modulateBy, modulateBy, modulateBy, modulateBy, modulateBy, modulateBy, modulateBy
forEachRemaining, remove
public SelectStep(Traversal.Admin traversal, Pop pop, String... selectKeys)
protected Traverser.Admin<Map<String,E>> processNextStart() throws NoSuchElementException
processNextStart
in class AbstractStep<S,Map<String,E>>
NoSuchElementException
public void reset()
Step
public SelectStep<S,E> clone()
Step
Step.reset()
is called. Moreover, the previous and next steps should be set to EmptyStep
.public void setTraversal(Traversal.Admin<?,?> parentTraversal)
Step
Traversal
that this step is contained within.setTraversal
in interface Step<S,Map<String,E>>
setTraversal
in class AbstractStep<S,Map<String,E>>
parentTraversal
- the new traversal for this steppublic List<Traversal.Admin<Object,E>> getLocalChildren()
getLocalChildren
in interface TraversalParent
public void modulateBy(Traversal.Admin<?,?> selectTraversal)
modulateBy
in interface ByModulating
public void replaceLocalChild(Traversal.Admin<?,?> oldTraversal, Traversal.Admin<?,?> newTraversal)
replaceLocalChild
in interface TraversalParent
public Set<TraverserRequirement> getRequirements()
Step
TraverserRequirement
that must be met by the traverser in order for the step to
function properly. The provided default implements returns an empty set.public Set<String> getScopeKeys()
Scoping
getScopeKeys
in interface Scoping
public List<String> getSelectKeys()
getScopeKeys()
, this returns a list possibly with
a duplicate key. This guarantees to return the keys in the same order as passed in.
TODO: getScopeKeys should return order-aware data structure instead of HashSet so that graph providers can
get the keys in the order passed in a query, and can associate them with by-traversals in a correct sequence.public Map<String,Traversal.Admin<Object,E>> getByTraversals()
public Pop getPop()
public void setKeepLabels(Set<String> keepLabels)
setKeepLabels
in interface PathProcessor
public Set<String> getKeepLabels()
getKeepLabels
in interface PathProcessor
Copyright © 2013–2022 Apache Software Foundation. All rights reserved.