org.apache.tinkerpop.gremlin.process.traversal

## Interface TraversalStrategies

- All Superinterfaces:
    Cloneable, Serializable
  All Known Implementing Classes:
    DefaultTraversalStrategies, EmptyTraversalStrategies

      public interface TraversalStrategies
      extends Serializable, Cloneable

  A `Traversal` maintains a set of `TraversalStrategy` instances within a TraversalStrategies object. TraversalStrategies are responsible for compiling a traversal prior to its execution.
  Author:
    Marko A. Rodriguez (http://markorodriguez.com), Matthias Broecheler (me@matthiasb.com)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `TraversalStrategies.GlobalCache`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static List<Class<? extends TraversalStrategy>>` | `STRATEGY_CATEGORIES`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `TraversalStrategies` | `addStrategies(TraversalStrategy<?>... strategies)` Add all the provided `TraversalStrategy` instances to the current collection.
    `void` | `applyStrategies(Traversal.Admin<?,?> traversal)` Deprecated. As of release 3.3.10, not directly replaced as this mode of strategy application has not been utilized since early days of 3.x
    `TraversalStrategies` | `clone()`
    `default <T extends TraversalStrategy> Optional<T>` | `getStrategy(Class<T> traversalStrategyClass)` Return the `TraversalStrategy` instance associated with the provided class.
    `TraversalStrategies` | `removeStrategies(Class<? extends TraversalStrategy>... strategyClasses)` Remove all the provided `TraversalStrategy` classes from the current collection.
    `static Set<TraversalStrategy<?>>` | `sortStrategies(Set<TraversalStrategy<?>> strategies)` Sorts the list of provided strategies such that the `TraversalStrategy.applyPost()` and `TraversalStrategy.applyPrior()` dependencies are respected.
    `List<TraversalStrategy<?>>` | `toList()` Return all the `TraversalStrategy` singleton instances associated with this `TraversalStrategies`.
    `static void` | `visit(Map<Class<? extends TraversalStrategy>,Set<Class<? extends TraversalStrategy>>> dependencyMap, List<Class<? extends TraversalStrategy>> sortedStrategyClasses, Set<Class<? extends TraversalStrategy>> seenStrategyClases, List<Class<? extends TraversalStrategy>> unprocessedStrategyClasses, Class<? extends TraversalStrategy> strategyClass)`

- - ### Field Detail

    - #### STRATEGY_CATEGORIES

          static final List<Class<? extends TraversalStrategy>> STRATEGY_CATEGORIES

  - ### Method Detail

    - #### toList

          List<TraversalStrategy<?>> toList()

      Return all the `TraversalStrategy` singleton instances associated with this `TraversalStrategies`.

    - #### getStrategy

          default <T extends TraversalStrategy> Optional<T> getStrategy(Class<T> traversalStrategyClass)

      Return the `TraversalStrategy` instance associated with the provided class.
      Type Parameters:
        `T` - the strategy class type
      Parameters:
        `traversalStrategyClass` - the class of the strategy to get
      Returns:
        an optional containing the strategy instance or not

    - #### applyStrategies

          @Deprecated
          void applyStrategies(Traversal.Admin<?,?> traversal)

      Deprecated. As of release 3.3.10, not directly replaced as this mode of strategy application has not been utilized since early days of 3.x
      Apply all the `TraversalStrategy` optimizers to the `Traversal`. This method must ensure that the strategies are sorted prior to application.
      Parameters:
        `traversal` - the traversal to apply the strategies to

    - #### addStrategies

          TraversalStrategies addStrategies(TraversalStrategy<?>... strategies)

      Add all the provided `TraversalStrategy` instances to the current collection. When all the provided strategies have been added, the collection is resorted.
      Parameters:
        `strategies` - the traversal strategies to add
      Returns:
        the newly updated/sorted traversal strategies collection

    - #### removeStrategies

          TraversalStrategies removeStrategies(Class<? extends TraversalStrategy>... strategyClasses)

      Remove all the provided `TraversalStrategy` classes from the current collection. When all the provided strategies have been removed, the collection is resorted.
      Parameters:
        `strategyClasses` - the traversal strategies to remove by their class
      Returns:
        the newly updated/sorted traversal strategies collection

    - #### clone

          TraversalStrategies clone()

    - #### sortStrategies

          static Set<TraversalStrategy<?>> sortStrategies(Set<TraversalStrategy<?>> strategies)

      Sorts the list of provided strategies such that the `TraversalStrategy.applyPost()` and `TraversalStrategy.applyPrior()` dependencies are respected.

      Note, that the order may not be unique.
      Parameters:
        `strategies` - the traversal strategies to sort

    - #### visit

          static void visit(Map<Class<? extends TraversalStrategy>,Set<Class<? extends TraversalStrategy>>> dependencyMap,
                            List<Class<? extends TraversalStrategy>> sortedStrategyClasses,
                            Set<Class<? extends TraversalStrategy>> seenStrategyClases,
                            List<Class<? extends TraversalStrategy>> unprocessedStrategyClasses,
                            Class<? extends TraversalStrategy> strategyClass)

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