public final class MatchStep<S,E> extends AbstractStep<S,Map<String,E>> implements TraversalParent
Modifier and Type | Class and Description |
---|---|
static class |
MatchStep.TraversalUpdater<A,B>
A helper object which wraps a traversal, submitting starts and counting results per start
|
static class |
MatchStep.TraversalWrapper<A,B>
A wrapper for a traversal in a query which maintains statistics about the traversal as
it consumes inputs and produces outputs.
|
id, label, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdSetByChild
Constructor and Description |
---|
MatchStep(Traversal.Admin traversal,
String startLabel,
Traversal... traversals) |
Modifier and Type | Method and Description |
---|---|
void |
addTraversal(Traversal<S,S> traversal)
Adds an individual traversal to an already-constructed MatchStep.
|
double |
findCost(String outLabel) |
List<Traversal> |
getLocalChildren() |
Set<TraverserRequirement> |
getRequirements()
Provide the necessary
TraverserRequirement that must be met by the traverser in order for the step to function properly. |
void |
optimize()
Computes and applies a new query plan based on gathered statistics about traversal inputs and outputs.
|
protected Traverser<Map<String,E>> |
processNextStart() |
void |
setStartsPerOptimize(int startsPerOptimize) |
Enumerator<S> |
solveFor(Iterator<S> inputs)
Directly applies this match query to a sequence of inputs
|
String |
summarize() |
String |
toString() |
addStart, addStarts, clone, getId, getLabel, getNextStep, getPreviousStep, getTraversal, hasNext, next, reset, setId, setLabel, setNextStep, setPreviousStep, setTraversal
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addGlobalChild, addLocalChild, asStep, getGlobalChildren, getSelfAndChildRequirements, integrateChild
forEachRemaining, remove
public MatchStep(Traversal.Admin traversal, String startLabel, Traversal... traversals)
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 void addTraversal(Traversal<S,S> traversal)
traversal
- the traversal to addpublic void setStartsPerOptimize(int startsPerOptimize)
protected Traverser<Map<String,E>> processNextStart() throws NoSuchElementException
processNextStart
in class AbstractStep<S,Map<String,E>>
NoSuchElementException
public String summarize()
public Enumerator<S> solveFor(Iterator<S> inputs)
inputs
- a sequence of inputspublic void optimize()
public double findCost(String outLabel)
outLabel
- the out-label of one or more traversals in the querypublic List<Traversal> getLocalChildren()
getLocalChildren
in interface TraversalParent
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.