org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization

## Class EarlyLimitStrategy

- java.lang.Object
- - org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
  - - org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.EarlyLimitStrategy

- All Implemented Interfaces:
    Serializable, Comparable<Class<? extends TraversalStrategy>>, TraversalStrategy<TraversalStrategy.OptimizationStrategy>, TraversalStrategy.OptimizationStrategy

      public final class EarlyLimitStrategy
      extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
      implements TraversalStrategy.OptimizationStrategy

  This strategy looks for `RangeGlobalStep`'s that can be moved further left in the traversal and thus be applied applied earlier. It will also try to merge multiple `RangeGlobalStep`'s into one. If the logical consequence of one or multiple `RangeGlobalStep`'s is an empty result, the strategy will remove as many steps as possible and add a `NoneStep` instead.
  Author:
    Daniel Kuppitz (http://gremlin.guru)
  See Also:
    Serialized Form
  Example:

         __.out().valueMap().limit(5)                          // becomes __.out().limit(5).valueMap()
         __.outE().range(2, 10).valueMap().limit(5)            // becomes __.outE().range(2, 7).valueMap()
         __.outE().limit(5).valueMap().range(2, -1)            // becomes __.outE().range(2, 5).valueMap()
         __.outE().limit(5).valueMap().range(5, 10)            // becomes __.outE().none()
         __.outE().limit(5).valueMap().range(5, 10).cap("a")   // becomes __.outE().none().cap("a")

- - ### 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 and Description
    --- | ---
    `void` | `apply(Traversal.Admin<?,?> traversal)`
    `static EarlyLimitStrategy` | `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.OptimizationStrategy

      `compareTo, getTraversalCategory`

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy

      `applyPost, applyPrior, getConfiguration`

- - ### Method Detail

    - #### apply

          public void apply(Traversal.Admin<?,?> traversal)

      Specified by:
        `apply` in interface `TraversalStrategy<TraversalStrategy.OptimizationStrategy>`

    - #### instance

          public static EarlyLimitStrategy instance()

Copyright © 2013–2019 Apache Software Foundation. All rights reserved.