public final class AdjacentToIncidentStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy
CountGlobalStep and replaces the
pattern with an edge- or property-emitting step followed by a CountGlobalStep. 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).
__.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())
TraversalStrategy.DecorationStrategy, TraversalStrategy.FinalizationStrategy, TraversalStrategy.OptimizationStrategy, TraversalStrategy.ProviderOptimizationStrategy, TraversalStrategy.VerificationStrategySTRATEGY| Modifier and Type | Method and Description |
|---|---|
void |
apply(Traversal.Admin<?,?> traversal) |
Set<Class<? extends TraversalStrategy.OptimizationStrategy>> |
applyPrior()
The set of strategies that must be executed before this strategy is executed.
|
static AdjacentToIncidentStrategy |
instance() |
equals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcompareTo, getTraversalCategoryapplyPost, getConfigurationpublic void apply(Traversal.Admin<?,?> traversal)
apply in interface TraversalStrategy<TraversalStrategy.OptimizationStrategy>public Set<Class<? extends TraversalStrategy.OptimizationStrategy>> applyPrior()
TraversalStrategyapplyPrior in interface TraversalStrategy<TraversalStrategy.OptimizationStrategy>public static AdjacentToIncidentStrategy instance()
Copyright © 2013–2022 Apache Software Foundation. All rights reserved.