Class IncidentToAdjacentStrategy
java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IncidentToAdjacentStrategy
- All Implemented Interfaces:
Serializable,Comparable<Class<? extends TraversalStrategy>>,TraversalStrategy<TraversalStrategy.OptimizationStrategy>,TraversalStrategy.OptimizationStrategy
public final class IncidentToAdjacentStrategy
extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
implements TraversalStrategy.OptimizationStrategy
This strategy looks for
.outE().inV(), .inE().outV() and .bothE().otherV()
and replaces these step sequences with .out(), .in() or .both() respectively.
The strategy won't modify the traversal if:
- the edge step is labeled
- the traversal contains a
pathstep - the traversal contains a lambda step
- Author:
- Daniel Kuppitz (http://gremlin.guru)
- See Also:
- Example:
__.outE().inV() // is replaced by __.out() __.inE().outV() // is replaced by __.in() __.bothE().otherV() // is replaced by __.both() __.bothE().bothV() // will not be modified __.outE().inV().path() // will not be modified __.outE().inV().tree() // will not be modified
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
TraversalStrategy.DecorationStrategy, TraversalStrategy.FinalizationStrategy, TraversalStrategy.OptimizationStrategy, TraversalStrategy.ProviderOptimizationStrategy, TraversalStrategy.VerificationStrategy -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(Traversal.Admin<?, ?> traversal) The transformation the strategy applies to the traversal.Set<Class<? extends TraversalStrategy.OptimizationStrategy>>TheGValueReductionStrategyshould be the last TinkerPop optimnization strategy applied.Set<Class<? extends TraversalStrategy.OptimizationStrategy>>The set of strategies that must be executed before this strategy is executed.static IncidentToAdjacentStrategyinstance()Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy
equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
getConfigurationMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy.OptimizationStrategy
compareTo, getTraversalCategory
-
Method Details
-
instance
-
apply
Description copied from interface:TraversalStrategyThe transformation the strategy applies to the traversal.- Specified by:
applyin interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
applyPrior
Description copied from interface:TraversalStrategyThe set of strategies that must be executed before this strategy is executed. If there are no ordering requirements, the default implementation returns an empty set.- Specified by:
applyPriorin interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>- Returns:
- the set of strategies that must be executed prior to this one.
-
applyPost
Description copied from interface:TraversalStrategy.OptimizationStrategyTheGValueReductionStrategyshould be the last TinkerPop optimnization strategy applied. Adding it here ensures will help to enforce that more globally. Implementations overriding this method should have a good reason to ignore this.- Specified by:
applyPostin interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>- Specified by:
applyPostin interfaceTraversalStrategy.OptimizationStrategy- Returns:
- the set of strategies that must be executed post this one
-