org.apache.tinkerpop.gremlin.process.traversal.traverser

## Class O_Traverser<T>

- java.lang.Object
- - org.apache.tinkerpop.gremlin.process.traversal.traverser.util.AbstractTraverser<T>
  - - org.apache.tinkerpop.gremlin.process.traversal.traverser.O_Traverser<T>

- All Implemented Interfaces:
    Serializable, Cloneable, Comparable<Traverser<T>>, Traverser<T>, Traverser.Admin<T>, Attachable<T>
  Direct Known Subclasses:
    B_O_Traverser, O_OB_S_SE_SL_Traverser

      public abstract class O_Traverser<T>
      extends AbstractTraverser<T>

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

- - ### Nested Class Summary

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

      `Traverser.Admin<T>`

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.util.Attachable

      `Attachable.Exceptions, Attachable.Method`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Set<String>` | `tags`

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.traverser.util.AbstractTraverser

      `t`

    - ### Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Traverser.Admin

      `HALT`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `O_Traverser()`
    `` | `O_Traverser(T t)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `equals(O_Traverser other)`
    `boolean` | `equals(Object object)`
    `Set<String>` | `getTags()` Get the tags associated with the traverser.
    `int` | `hashCode()`
    `void` | `merge(Traverser.Admin<?> other)` When two traversers are have equality with each other, then they can be merged.
    `Traverser.Admin<T>` | `split()` Generate a sibling traverser of the current traverser with a full copy of all state within the sibling.
    `<R> Traverser.Admin<R>` | `split(R r, Step<T,R> step)` Generate a child traverser of the current traverser for current as step and new object location.

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.traverser.util.AbstractTraverser

      `addLabels, attach, bulk, clone, detach, dropLabels, dropPath, get, getSideEffects, getStepId, incrLoops, keepLabels, loops, path, resetLoops, sack, sack, set, setBulk, setSideEffects, setStepId, toString`

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

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

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

      `isHalted`

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

      `asAdmin, compareTo, path, path, sideEffects, sideEffects`

- - ### Field Detail

    - #### tags

          protected Set<String> tags

  - ### Constructor Detail

    - #### O_Traverser

          protected O_Traverser()

    - #### O_Traverser

          public O_Traverser(T t)

  - ### Method Detail

    - #### getTags

          public Set<String> getTags()

      Description copied from interface: `Traverser.Admin`
      Get the tags associated with the traverser. Tags are used to categorize historic behavior of a traverser. The returned set is mutable.
      Returns:
        the set of tags associated with the traverser.

    - #### split

          public <R> Traverser.Admin<R> split(R r,
                                              Step<T,R> step)

      Description copied from interface: `Traverser.Admin`
      Generate a child traverser of the current traverser for current as step and new object location. The child has the path history, future, and loop information of the parent. The child extends that path history with the current as and provided R-object.
      Specified by:
        `split` in interface `Traverser.Admin<T>`
      Overrides:
        `split` in class `AbstractTraverser<T>`
      Type Parameters:
        `R` - The current object type of the child
      Parameters:
        `r` - The current object of the child
        `step` - The step yielding the split
      Returns:
        The split traverser

    - #### split

          public Traverser.Admin<T> split()

      Description copied from interface: `Traverser.Admin`
      Generate a sibling traverser of the current traverser with a full copy of all state within the sibling.
      Specified by:
        `split` in interface `Traverser.Admin<T>`
      Overrides:
        `split` in class `AbstractTraverser<T>`
      Returns:
        The split traverser

    - #### merge

          public void merge(Traverser.Admin<?> other)

      Description copied from interface: `Traverser.Admin`
      When two traversers are have equality with each other, then they can be merged. This method is used to merge the traversers into a single traverser. This is used for optimization where instead of enumerating all traversers, they can be counted.
      Specified by:
        `merge` in interface `Traverser.Admin<T>`
      Overrides:
        `merge` in class `AbstractTraverser<T>`
      Parameters:
        `other` - the other traverser to merge into this traverser. Once merged, the other can be garbage collected.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `AbstractTraverser<T>`

    - #### equals

          protected final boolean equals(O_Traverser other)

    - #### equals

          public boolean equals(Object object)

      Overrides:
        `equals` in class `AbstractTraverser<T>`

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