org.apache.tinkerpop.gremlin.process.traversal.step.branch

## Class RepeatStep<S>

- java.lang.Object
- - org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep<S,E>
  - - org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep<S,S>
    - - org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep<S>

- All Implemented Interfaces:
    Serializable, AutoCloseable, Cloneable, Iterator<Traverser.Admin<S>>, Step<S,S>, GraphComputing, TraversalParent

      public final class RepeatStep<S>
      extends ComputerAwareStep<S,S>
      implements TraversalParent

  Author:
    Marko A. Rodriguez (http://markorodriguez.com)
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RepeatStep.RepeatEndStep<S>`

    - ### Nested classes/interfaces inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep

      `ComputerAwareStep.EndStep<S>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `emitFirst`
    `boolean` | `untilFirst`

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep

      `id, labels, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdAndLabelsSetByChild`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RepeatStep(Traversal.Admin traversal)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <A,B,C extends Traversal<A,B>> C` | `addEmitToTraversal(C traversal, Traversal.Admin<B,?> emitPredicate)`
    `static <A,B,C extends Traversal<A,B>> C` | `addRepeatToTraversal(C traversal, String loopName, Traversal.Admin<B,B> repeatTraversal)`
    `static <A,B,C extends Traversal<A,B>> C` | `addRepeatToTraversal(C traversal, Traversal.Admin<B,B> repeatTraversal)`
    `static <A,B,C extends Traversal<A,B>> C` | `addUntilToTraversal(C traversal, Traversal.Admin<B,?> untilPredicate)`
    `RepeatStep<S>` | `clone()` Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.
    `protected Iterator<Traverser.Admin<S>>` | `computerAlgorithm()`
    `boolean` | `doEmit(Traverser.Admin<S> traverser, boolean emitFirst)`
    `boolean` | `doUntil(Traverser.Admin<S> traverser, boolean utilFirst)`
    `Traversal.Admin<S,?>` | `getEmitTraversal()`
    `List<Traversal.Admin<S,S>>` | `getGlobalChildren()`
    `List<Traversal.Admin<S,?>>` | `getLocalChildren()`
    `Traversal.Admin<S,S>` | `getRepeatTraversal()`
    `Set<TraverserRequirement>` | `getRequirements()` Provide the necessary `TraverserRequirement` that must be met by the traverser in order for the step to function properly.
    `Traversal.Admin<S,?>` | `getUntilTraversal()`
    `int` | `hashCode()`
    `void` | `reset()` Reset the state of the step such that it has no incoming starts.
    `void` | `setEmitTraversal(Traversal.Admin<S,?> emitTraversal)`
    `void` | `setLoopName(String loopName)`
    `void` | `setRepeatTraversal(Traversal.Admin<S,S> repeatTraversal)`
    `void` | `setTraversal(Traversal.Admin<?,?> parentTraversal)` Set the `Traversal` that this step is contained within.
    `void` | `setUntilTraversal(Traversal.Admin<S,?> untilTraversal)`
    `protected Iterator<Traverser.Admin<S>>` | `standardAlgorithm()`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep

      `onGraphComputer, processNextStart`

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep

      `addLabel, addStart, addStarts, equals, getId, getLabels, getNextStep, getPreviousStep, getStarts, getTraversal, hasNext, isTraverserStepIdAndLabelsSetByChild, next, prepareTraversalForNextStep, removeLabel, setId, setNextStep, setPreviousStep`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

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

      `addGlobalChild, addLocalChild, asStep, close, getSelfAndChildRequirements, integrateChild, removeGlobalChild, removeLocalChild`

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

      `atMaster, atMaster`

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

      `equals`

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

      `forEachRemaining, remove`

- - ### Field Detail

    - #### untilFirst

          public boolean untilFirst

    - #### emitFirst

          public boolean emitFirst

  - ### Constructor Detail

    - #### RepeatStep

          public RepeatStep(Traversal.Admin traversal)

  - ### Method Detail

    - #### getRequirements

          public Set<TraverserRequirement> getRequirements()

      Description copied from interface: `Step`
      Provide the necessary `TraverserRequirement` that must be met by the traverser in order for the step to function properly. The provided default implements returns an empty set.
      Specified by:
        `getRequirements` in interface `Step<S,S>`
      Returns:
        the set of requirements

    - #### setRepeatTraversal

          public void setRepeatTraversal(Traversal.Admin<S,S> repeatTraversal)

    - #### setLoopName

          public void setLoopName(String loopName)

    - #### setUntilTraversal

          public void setUntilTraversal(Traversal.Admin<S,?> untilTraversal)

    - #### getUntilTraversal

          public Traversal.Admin<S,?> getUntilTraversal()

    - #### setEmitTraversal

          public void setEmitTraversal(Traversal.Admin<S,?> emitTraversal)

    - #### getEmitTraversal

          public Traversal.Admin<S,?> getEmitTraversal()

    - #### getRepeatTraversal

          public Traversal.Admin<S,S> getRepeatTraversal()

    - #### getGlobalChildren

          public List<Traversal.Admin<S,S>> getGlobalChildren()

      Specified by:
        `getGlobalChildren` in interface `TraversalParent`

    - #### getLocalChildren

          public List<Traversal.Admin<S,?>> getLocalChildren()

      Specified by:
        `getLocalChildren` in interface `TraversalParent`

    - #### doUntil

          public final boolean doUntil(Traverser.Admin<S> traverser,
                                       boolean utilFirst)

    - #### doEmit

          public final boolean doEmit(Traverser.Admin<S> traverser,
                                      boolean emitFirst)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractStep<S,S>`

    - #### reset

          public void reset()

      Description copied from interface: `Step`
      Reset the state of the step such that it has no incoming starts. Internal states are to be reset, but any sideEffect data structures are not to be recreated.
      Specified by:
        `reset` in interface `Step<S,S>`
      Overrides:
        `reset` in class `ComputerAwareStep<S,S>`

    - #### clone

          public RepeatStep<S> clone()

      Description copied from interface: `Step`
      Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication. When cloning a step, it is important that the steps, the cloned step is equivalent to the state of the step when `Step.reset()` is called. Moreover, the previous and next steps should be set to `EmptyStep`.
      Specified by:
        `clone` in interface `Step<S,S>`
      Overrides:
        `clone` in class `ComputerAwareStep<S,S>`
      Returns:
        The cloned step

    - #### setTraversal

          public void setTraversal(Traversal.Admin<?,?> parentTraversal)

      Description copied from interface: `Step`
      Set the `Traversal` that this step is contained within.
      Specified by:
        `setTraversal` in interface `Step<S,S>`
      Overrides:
        `setTraversal` in class `AbstractStep<S,S>`
      Parameters:
        `parentTraversal` - the new traversal for this step

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `AbstractStep<S,S>`

    - #### standardAlgorithm

          protected Iterator<Traverser.Admin<S>> standardAlgorithm()
                                                            throws NoSuchElementException

      Specified by:
        `standardAlgorithm` in class `ComputerAwareStep<S,S>`
      Throws:
        `NoSuchElementException`

    - #### computerAlgorithm

          protected Iterator<Traverser.Admin<S>> computerAlgorithm()
                                                            throws NoSuchElementException

      Specified by:
        `computerAlgorithm` in class `ComputerAwareStep<S,S>`
      Throws:
        `NoSuchElementException`

    - #### addRepeatToTraversal

          public static <A,B,C extends Traversal<A,B>> C addRepeatToTraversal(C traversal,
                                                                              Traversal.Admin<B,B> repeatTraversal)

    - #### addRepeatToTraversal

          public static <A,B,C extends Traversal<A,B>> C addRepeatToTraversal(C traversal,
                                                                              String loopName,
                                                                              Traversal.Admin<B,B> repeatTraversal)

    - #### addUntilToTraversal

          public static <A,B,C extends Traversal<A,B>> C addUntilToTraversal(C traversal,
                                                                             Traversal.Admin<B,?> untilPredicate)

    - #### addEmitToTraversal

          public static <A,B,C extends Traversal<A,B>> C addEmitToTraversal(C traversal,
                                                                            Traversal.Admin<B,?> emitPredicate)

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