org.apache.tinkerpop.gremlin.process.traversal

## Interface TraversalStrategies

- All Superinterfaces:
    Cloneable, Iterable<TraversalStrategy<?>>, Serializable

      public interface TraversalStrategies
      extends Serializable, Cloneable, Iterable<TraversalStrategy<?>>

  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
    Modifier and Type | Method and Description
    --- | ---
    `TraversalStrategies` | `addStrategies(TraversalStrategy<?>... strategies)` Add all the provided `TraversalStrategy` instances to the current collection.
    `TraversalStrategies` | `clone()`
    `default <T extends TraversalStrategy> Optional<T>` | `getStrategy(Class<T> traversalStrategyClass)` Return the `TraversalStrategy` instance associated with the provided class.
    `Iterator<TraversalStrategy<?>>` | `iterator()` Return an `Iterator` of the `TraversalStrategy` instances.
    `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.
    `default List<TraversalStrategy<?>>` | `toList()` Return an immutable list of the `TraversalStrategy` instances.
    `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)`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### STRATEGY_CATEGORIES

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

  - ### Method Detail

    - #### toList

          default List<TraversalStrategy<?>> toList()

      Return an immutable list of the `TraversalStrategy` instances.

    - #### iterator

          Iterator<TraversalStrategy<?>> iterator()

      Return an `Iterator` of the `TraversalStrategy` instances.
      Specified by:
        `iterator` in interface `Iterable<TraversalStrategy<?>>`

    - #### 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

    - #### 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. If a strategy class is found to already be defined, it is removed and replaced by the newly added one.
      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–2022 Apache Software Foundation. All rights reserved.