Class CountStrategy
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.CountStrategy
-
- All Implemented Interfaces:
Serializable
,Comparable<Class<? extends TraversalStrategy>>
,TraversalStrategy<TraversalStrategy.OptimizationStrategy>
,TraversalStrategy.OptimizationStrategy
public final class CountStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy
This strategy optimizes any occurrence ofCountGlobalStep
followed by anIsStep
. The idea is to limit the number of incoming elements in a way that it's enough for theIsStep
to decide whether it evaluatestrue
orfalse
. If the traversal already contains a user supplied limit, the strategy won't modify it.- Author:
- Daniel Kuppitz (http://gremlin.guru)
- See Also:
- Serialized Form
- Example:
__.outE().count().is(0) // is replaced by __.not(outE()) __.outE().count().is(lt(3)) // is replaced by __.outE().limit(3).count().is(lt(3)) __.outE().count().is(gt(3)) // is replaced by __.outE().limit(4).count().is(gt(3))
-
-
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
-
-
Field Summary
-
Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
STRATEGY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(Traversal.Admin<?,?> traversal)
static CountStrategy
instance()
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
applyPost, applyPrior, getConfiguration
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy.OptimizationStrategy
compareTo, getTraversalCategory
-
-
-
-
Method Detail
-
instance
public static CountStrategy instance()
-
apply
public void apply(Traversal.Admin<?,?> traversal)
- Specified by:
apply
in interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
-