Class AdjacentToIncidentStrategy
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
- 
- org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.AdjacentToIncidentStrategy
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<Class<? extends TraversalStrategy>>,- TraversalStrategy<TraversalStrategy.OptimizationStrategy>,- TraversalStrategy.OptimizationStrategy
 
 public final class AdjacentToIncidentStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy This strategy looks for vertex- and value-emitting steps followed by aCountGlobalStepand replaces the pattern with an edge- or property-emitting step followed by aCountGlobalStep. Furthermore, if a vertex- or value-emitting step is the last step in a.has(traversal),.and(traversal, ...)or.or(traversal, ...)child traversal, it is replaced by an appropriate edge- or property-emitting step. Performing this replacement removes situations where the more expensive trip to an adjacent graph element (e.g. the vertex on the other side of an edge) can be satisfied by trips to incident graph elements (e.g. just the edge itself).- Author:
- Daniel Kuppitz (http://gremlin.guru)
- See Also:
- Serialized Form
- Example:
- __.out().count() // is replaced by __.outE().count() __.in().limit(3).count() // is replaced by __.inE().limit(3).count() __.values("name").count() // is replaced by __.properties("name").count() __.where(__.out()) // is replaced by __.where(__.outE()) __.where(__.values()) // is replaced by __.where(__.properties()) __.and(__.in(), __.out()) // is replaced by __.and(__.inE(), __.outE())
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategyTraversalStrategy.DecorationStrategy, TraversalStrategy.FinalizationStrategy, TraversalStrategy.OptimizationStrategy, TraversalStrategy.ProviderOptimizationStrategy, TraversalStrategy.VerificationStrategy
 
- 
 - 
Field Summary- 
Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategySTRATEGY
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(Traversal.Admin<?,?> traversal)Set<Class<? extends TraversalStrategy.OptimizationStrategy>>applyPrior()The set of strategies that must be executed before this strategy is executed.static AdjacentToIncidentStrategyinstance()- 
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategyequals, hashCode, toString
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategyapplyPost, getConfiguration
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy.OptimizationStrategycompareTo, getTraversalCategory
 
- 
 
- 
- 
- 
Method Detail- 
applypublic void apply(Traversal.Admin<?,?> traversal) - Specified by:
- applyin interface- TraversalStrategy<TraversalStrategy.OptimizationStrategy>
 
 - 
applyPriorpublic Set<Class<? extends 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 interface- TraversalStrategy<TraversalStrategy.OptimizationStrategy>
- Returns:
- the set of strategies that must be executed prior to this one.
 
 - 
instancepublic static AdjacentToIncidentStrategy instance() 
 
- 
 
-