org.apache.tinkerpop.gremlin.process.traversal

## Interface Traversal.Admin<S,E>

- All Superinterfaces:
    AutoCloseable, Cloneable, Iterator<E>, Serializable, Traversal<S,E>
  All Known Subinterfaces:
    GraphTraversal.Admin<S,E>
  Enclosing interface:
    Traversal<S,E>

      public static interface Traversal.Admin<S,E>
      extends Traversal<S,E>

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Traversal

      `Traversal.Admin<S,E>, Traversal.Exceptions, Traversal.Symbols`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default void` | `addStart(Traverser.Admin<S> start)` Add a single `Traverser.Admin` object to the head of the traversal.
    `default void` | `addStarts(Iterator<Traverser.Admin<S>> starts)` Add an iterator of `Traverser.Admin` objects to the head/start of the traversal.
    `<S2,E2> Traversal.Admin<S2,E2>` | `addStep(int index, Step<?,?> step)` Add a `Step` to an arbitrary point in the traversal.
    `default <E2> Traversal.Admin<S,E2>` | `addStep(Step<?,E2> step)` Add a `Step` to the end of the traversal.
    `void` | `applyStrategies()` Apply the registered `TraversalStrategies` to the traversal.
    `Traversal.Admin<S,E>` | `clone()` Cloning is used to duplicate the traversal typically in OLAP environments.
    `default boolean` | `equals(Traversal.Admin<S,E> other)`
    `Bytecode` | `getBytecode()` Get the `Bytecode` associated with the construction of this traversal.
    `default Step<?,E>` | `getEndStep()` Get the end/tail of the traversal.
    `Optional<Graph>` | `getGraph()` Gets the `Graph` instance associated to this `Traversal`.
    `org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent` | `getParent()` Get the `TraversalParent` `Step` that is the parent of this traversal.
    `TraversalSideEffects` | `getSideEffects()` Get the `TraversalSideEffects` associated with the traversal.
    `default Step<S,?>` | `getStartStep()` Get the start/head of the traversal.
    `List<Step>` | `getSteps()` Get the `Step` instances associated with this traversal.
    `TraversalStrategies` | `getStrategies()` Get the `TraversalStrategies` associated with this traversal.
    `default Optional<TraversalSource>` | `getTraversalSource()` Gets the `TraversalSource` that spawned the `Traversal` instance initially if present.
    `TraverserGenerator` | `getTraverserGenerator()` Get the `TraverserGenerator` associated with this traversal.
    `Set<org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement>` | `getTraverserRequirements()` Get the set of all `TraverserRequirement`s for this traversal.
    `default Supplier<org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet<S>>` | `getTraverserSetSupplier()` Gets a generator that creates new `TraverserSet` instances for steps in the traversal.
    `boolean` | `isLocked()` When the traversal has had its `TraversalStrategies` applied to it, it is locked.
    `default Traverser.Admin<E>` | `nextTraverser()`
    `<S2,E2> Traversal.Admin<S2,E2>` | `removeStep(int index)` Remove a `Step` from the traversal.
    `default <S2,E2> Traversal.Admin<S2,E2>` | `removeStep(Step<?,?> step)` Remove a `Step` from the traversal.
    `default void` | `reset()` Call the `Step.reset()` method on every step in the traversal.
    `void` | `setGraph(Graph graph)`
    `void` | `setParent(org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent step)` Set the `TraversalParent` `Step` that is the parent of this traversal.
    `void` | `setSideEffects(TraversalSideEffects sideEffects)` Set the `TraversalSideEffects` of this traversal.
    `void` | `setStrategies(TraversalStrategies strategies)` Set the `TraversalStrategies` to be used by this traversal at evaluation time.

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

      `asAdmin, close, explain, fill, forEachRemaining, forEachRemaining, iterate, next, none, profile, promise, toBulkSet, toList, toSet, toStream, tryNext`

    - ### Methods inherited from interface java.util.Iterator

      `hasNext, next, remove`

- - ### Method Detail

    - #### getBytecode

          Bytecode getBytecode()

      Get the `Bytecode` associated with the construction of this traversal.
      Returns:
        the byte code representation of the traversal

    - #### addStarts

          default void addStarts(Iterator<Traverser.Admin<S>> starts)

      Add an iterator of `Traverser.Admin` objects to the head/start of the traversal. Users should typically not need to call this method. For dynamic inject of data, they should use `InjectStep`.
      Parameters:
        `starts` - an iterators of traversers

    - #### addStart

          default void addStart(Traverser.Admin<S> start)

      Add a single `Traverser.Admin` object to the head of the traversal. Users should typically not need to call this method. For dynamic inject of data, they should use `InjectStep`.
      Parameters:
        `start` - a traverser to add to the traversal

    - #### getSteps

          List<Step> getSteps()

      Get the `Step` instances associated with this traversal. The steps are ordered according to their linked list structure as defined by `Step.getPreviousStep()` and `Step.getNextStep()`.
      Returns:
        the ordered steps of the traversal

    - #### addStep

          default <E2> Traversal.Admin<S,E2> addStep(Step<?,E2> step)
                                              throws IllegalStateException

      Add a `Step` to the end of the traversal. This method should link the step to its next and previous step accordingly.
      Type Parameters:
        `E2` - the output of the step
      Parameters:
        `step` - the step to add
      Returns:
        the updated traversal
      Throws:
        `IllegalStateException` - if the `TraversalStrategies` have already been applied

    - #### addStep

          <S2,E2> Traversal.Admin<S2,E2> addStep(int index,
                                                 Step<?,?> step)
                                          throws IllegalStateException

      Add a `Step` to an arbitrary point in the traversal.
      Type Parameters:
        `S2` - the new start type of the traversal (if the added step was a start step)
        `E2` - the new end type of the traversal (if the added step was an end step)
      Parameters:
        `index` - the location in the traversal to insert the step
        `step` - the step to add
      Returns:
        the newly modulated traversal
      Throws:
        `IllegalStateException` - if the `TraversalStrategies` have already been applied

    - #### removeStep

          default <S2,E2> Traversal.Admin<S2,E2> removeStep(Step<?,?> step)
                                                     throws IllegalStateException

      Remove a `Step` from the traversal.
      Type Parameters:
        `S2` - the new start type of the traversal (if the removed step was a start step)
        `E2` - the new end type of the traversal (if the removed step was an end step)
      Parameters:
        `step` - the step to remove
      Returns:
        the newly modulated traversal
      Throws:
        `IllegalStateException` - if the `TraversalStrategies` have already been applied

    - #### removeStep

          <S2,E2> Traversal.Admin<S2,E2> removeStep(int index)
                                             throws IllegalStateException

      Remove a `Step` from the traversal.
      Type Parameters:
        `S2` - the new start type of the traversal (if the removed step was a start step)
        `E2` - the new end type of the traversal (if the removed step was an end step)
      Parameters:
        `index` - the location in the traversal of the step to be evicted
      Returns:
        the newly modulated traversal
      Throws:
        `IllegalStateException` - if the `TraversalStrategies` have already been applied

    - #### getStartStep

          default Step<S,?> getStartStep()

      Get the start/head of the traversal. If the traversal is empty, then an `EmptyStep` instance is returned.
      Returns:
        the start step of the traversal

    - #### getEndStep

          default Step<?,E> getEndStep()

      Get the end/tail of the traversal. If the traversal is empty, then an `EmptyStep` instance is returned.
      Returns:
        the end step of the traversal

    - #### applyStrategies

          void applyStrategies()
                        throws IllegalStateException

      Apply the registered `TraversalStrategies` to the traversal. Once the strategies are applied, the traversal is "locked" and can no longer have steps added to it. The order of operations for strategy applications should be: globally id steps, apply strategies to root traversal, then to nested traversals.
      Throws:
        `IllegalStateException` - if the `TraversalStrategies` have already been applied

    - #### getTraverserGenerator

          TraverserGenerator getTraverserGenerator()

      Get the `TraverserGenerator` associated with this traversal. The traversal generator creates `Traverser` instances that are respective of the traversal's `TraverserRequirement`.
      Returns:
        the generator of traversers

    - #### getTraverserSetSupplier

          default Supplier<org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet<S>> getTraverserSetSupplier()

      Gets a generator that creates new `TraverserSet` instances for steps in the traversal. Providers may override this default implementation to provider their own `TraverserSet`.

    - #### getTraverserRequirements

          Set<org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement> getTraverserRequirements()

      Get the set of all `TraverserRequirement`s for this traversal.
      Returns:
        the features of a traverser that are required to execute properly in this traversal

    - #### reset

          default void reset()

      Call the `Step.reset()` method on every step in the traversal.

    - #### setSideEffects

          void setSideEffects(TraversalSideEffects sideEffects)

      Set the `TraversalSideEffects` of this traversal.
      Parameters:
        `sideEffects` - the sideEffects to set for this traversal.

    - #### getSideEffects

          TraversalSideEffects getSideEffects()

      Get the `TraversalSideEffects` associated with the traversal. This method should not be called externally for purposes of retrieving side-effects as traversal results. Traversal results should only be returned by way of the execution of the traversal itself. Should a side-effect of a traversal be needed it should only be obtained by using `GraphTraversal.cap(String, String...)` so that the side-effect can be included as part of the traversal iteration. Relying on this method to get side-effects in these situations may not result in consistent behavior across all types of executions and environments (e.g. remoting).
      Returns:
        The traversal sideEffects

    - #### setStrategies

          void setStrategies(TraversalStrategies strategies)

      Set the `TraversalStrategies` to be used by this traversal at evaluation time.
      Parameters:
        `strategies` - the strategies to use on this traversal

    - #### getStrategies

          TraversalStrategies getStrategies()

      Get the `TraversalStrategies` associated with this traversal.
      Returns:
        the strategies associated with this traversal

    - #### setParent

          void setParent(org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent step)

      Set the `TraversalParent` `Step` that is the parent of this traversal. Traversals can be nested and this is the means by which the traversal tree is connected.
      Parameters:
        `step` - the traversal holder parent step

    - #### getParent

          org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent getParent()

      Get the `TraversalParent` `Step` that is the parent of this traversal. Traversals can be nested and this is the means by which the traversal tree is walked.
      Returns:
        the traversal holder parent step

    - #### clone

          Traversal.Admin<S,E> clone()

      Cloning is used to duplicate the traversal typically in OLAP environments.
      Returns:
        The cloned traversal

    - #### isLocked

          boolean isLocked()

      When the traversal has had its `TraversalStrategies` applied to it, it is locked.
      Returns:
        whether the traversal is locked

    - #### getGraph

          Optional<Graph> getGraph()

      Gets the `Graph` instance associated to this `Traversal`.

    - #### getTraversalSource

          default Optional<TraversalSource> getTraversalSource()

      Gets the `TraversalSource` that spawned the `Traversal` instance initially if present. This `TraversalSource` should have spawned from the associated `Graph` returned from `getGraph()`.

    - #### setGraph

          void setGraph(Graph graph)

    - #### equals

          default boolean equals(Traversal.Admin<S,E> other)

    - #### nextTraverser

          default Traverser.Admin<E> nextTraverser()

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