public interface TraversalStrategies extends Serializable, Cloneable
Traversal
maintains a set of TraversalStrategy
instances within a TraversalStrategies object.
TraversalStrategies are responsible for compiling a traversal prior to its execution.Modifier and Type | Interface and Description |
---|---|
static class |
TraversalStrategies.GlobalCache |
Modifier and Type | Field and Description |
---|---|
static List<Class<? extends TraversalStrategy>> |
STRATEGY_CATEGORIES |
Modifier and Type | Method and Description |
---|---|
TraversalStrategies |
addStrategies(TraversalStrategy<?>... strategies)
Add all the provided
TraversalStrategy instances to the current collection. |
void |
applyStrategies(Traversal.Admin<?,?> traversal)
|
TraversalStrategies |
clone() |
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserGeneratorFactory |
getTraverserGeneratorFactory()
Get the
TraverserGeneratorFactory to use to generate traversers. |
TraversalStrategies |
removeStrategies(Class<? extends TraversalStrategy>... strategyClasses)
Remove all the provided
TraversalStrategy classes from the current collection. |
void |
setTraverserGeneratorFactory(org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserGeneratorFactory traverserGeneratorFactory)
|
static List<TraversalStrategy<?>> |
sortStrategies(List<TraversalStrategy<?>> strategies)
Sorts the list of provided strategies such that the
TraversalStrategy.applyPost()
and TraversalStrategy.applyPrior() dependencies are respected. |
List<TraversalStrategy<?>> |
toList()
Return all the
TraversalStrategy singleton instances associated with this TraversalStrategies . |
static void |
visit(Map<Class<? extends TraversalStrategy>,Set<Class<? extends TraversalStrategy>>> dependencyMap,
List<Class<? extends TraversalStrategy>> sortedStrategyClasses,
Set<Class<? extends TraversalStrategy>> seenStrategyClases,
List<Class<? extends TraversalStrategy>> unprocessedStrategyClasses,
Class<? extends TraversalStrategy> strategyClass) |
static final List<Class<? extends TraversalStrategy>> STRATEGY_CATEGORIES
List<TraversalStrategy<?>> toList()
TraversalStrategy
singleton instances associated with this TraversalStrategies
.void applyStrategies(Traversal.Admin<?,?> traversal)
TraversalStrategy
optimizers to the Traversal
for the stated TraversalEngine
.
This method must ensure that the strategies are sorted prior to application.traversal
- the traversal to apply the strategies toTraversalStrategies addStrategies(TraversalStrategy<?>... strategies)
TraversalStrategy
instances to the current collection.
When all the provided strategies have been added, the collection is resorted.strategies
- the traversal strategies to addTraversalStrategies removeStrategies(Class<? extends TraversalStrategy>... strategyClasses)
TraversalStrategy
classes from the current collection.
When all the provided strategies have been removed, the collection is resorted.strategyClasses
- the traversal strategies to remove by their classTraversalStrategies clone()
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserGeneratorFactory getTraverserGeneratorFactory()
TraverserGeneratorFactory
to use to generate traversers.void setTraverserGeneratorFactory(org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserGeneratorFactory traverserGeneratorFactory)
TraverserGeneratorFactory
to use for determining which Traverser
type to generate for the Traversal
.traverserGeneratorFactory
- the factory to usestatic List<TraversalStrategy<?>> sortStrategies(List<TraversalStrategy<?>> strategies)
TraversalStrategy.applyPost()
and TraversalStrategy.applyPrior()
dependencies are respected.
Note, that the order may not be unique.strategies
- the traversal strategies to sortstatic void visit(Map<Class<? extends TraversalStrategy>,Set<Class<? extends TraversalStrategy>>> dependencyMap, List<Class<? extends TraversalStrategy>> sortedStrategyClasses, Set<Class<? extends TraversalStrategy>> seenStrategyClases, List<Class<? extends TraversalStrategy>> unprocessedStrategyClasses, Class<? extends TraversalStrategy> strategyClass)
Copyright © 2013–2017 Apache Software Foundation. All rights reserved.