Interface Traverser.Admin<T>

  • All Superinterfaces:
    org.apache.tinkerpop.gremlin.structure.util.Attachable<T>, Cloneable, Comparable<Traverser<T>>, Serializable, Traverser<T>
    Enclosing interface:

    public static interface Traverser.Admin<T>
    extends Traverser<T>, org.apache.tinkerpop.gremlin.structure.util.Attachable<T>
    The methods in System.Traverser are useful to underlying Step and Traversal implementations. They should not be accessed by the user during lambda-based manipulations.
    • Nested Class Summary

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

        org.apache.tinkerpop.gremlin.structure.util.Attachable.Exceptions, org.apache.tinkerpop.gremlin.structure.util.Attachable.Method
    • Field Summary

      Modifier and Type Field Description
      static String HALT  
      • Fields inherited from interface org.apache.tinkerpop.gremlin.structure.util.Attachable

    • Method Detail

      • merge

        void merge​(Traverser.Admin<?> other)
        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.
        other - the other traverser to merge into this traverser. Once merged, the other can be garbage collected.
      • split

        <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. 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.
        Type Parameters:
        R - The current object type of the child
        r - The current object of the child
        step - The step yielding the split
        The split traverser
      • split

        Traverser.Admin<T> split()
        Generate a sibling traverser of the current traverser with a full copy of all state within the sibling.
        The split traverser
      • addLabels

        void addLabels​(Set<String> labels)
      • keepLabels

        void keepLabels​(Set<String> labels)
        Drop all path information not associated with specified labels. This is an optimization method that allows a traverser to save memory and increase the likelihood of bulking.
        labels - the labels to keep path information for.
      • dropLabels

        void dropLabels​(Set<String> labels)
        Drop all path information associated with specified labels. This is an optimization method that allows a traverser to save memory and increase the likelihood of bulking.
        labels - the labels to drop path information for.
      • dropPath

        void dropPath()
        Drop the path of the traverser. This is an optimization method that allows a traverser to save memory and increase the likelihood of bulking.
      • set

        void set​(T t)
        Set the current object location of the traverser.
        t - The current object of the traverser
      • initialiseLoops

        void initialiseLoops​(String stepLabel,
                             String loopName)
        Initialise a loop by setting up the looping construct. The step label is important to create a stack of loop counters when within a nested context. If the provided label is not the same as the current label on the stack, add a new loop counter. The loopName can be used to refer to the loops counter via the LoopsStep
        stepLabel - the label of the step that is being set-up.
        loopName - the user defined name for referencing the loop counter or null if not set
      • incrLoops

        void incrLoops()
        Increment the number of times the traverser has gone through a looping section of traversal.
      • resetLoops

        void resetLoops()
        Set the number of times the traverser has gone through a loop back to 0. When a traverser exits a looping construct, this method should be called. In a nested loop context, the highest stack loop counter should be removed.
      • getStepId

        String getStepId()
        Get the step id of where the traverser is located. This is typically used in multi-machine systems that require the movement of traversers between different traversal instances.
        The future step for the traverser
      • setStepId

        void setStepId​(String stepId)
        Set the step id of where the traverser is located. If the future is HALT, then isHalted() is true.
        stepId - The future step of the traverser
      • isHalted

        default boolean isHalted()
        If the traverser has "no future" then it is done with its lifecycle. This does not mean that the traverser is "dead," only that it has successfully passed through a Traversal.
        Whether the traverser is done executing or not
      • setBulk

        void setBulk​(long count)
        Set the number of traversers represented by this traverser.
        count - the number of traversers
      • detach

        Traverser.Admin<T> detach()
        Prepare the traverser for migration across a JVM boundary.
        The deflated traverser
      • attach

        T attach​(Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<T>,​T> method)
        Regenerate the detached traverser given its location at a particular vertex.
        Specified by:
        attach in interface org.apache.tinkerpop.gremlin.structure.util.Attachable<T>
        method - The method by which to attach a Traverser to an vertex.
        The inflated traverser
      • setSideEffects

        void setSideEffects​(TraversalSideEffects sideEffects)
        Set the sideEffects of the Traversal. Given that traversers can move between machines, it may be important to re-set this when the traverser crosses machine boundaries.
        sideEffects - the sideEffects of the traversal.
      • getSideEffects

        TraversalSideEffects getSideEffects()
        Get the sideEffects associated with the traversal of the traverser.
        the traversal sideEffects of the traverser
      • getTags

        Set<String> getTags()
        Get the tags associated with the traverser. Tags are used to categorize historic behavior of a traverser. The returned set is mutable.
        the set of tags associated with the traverser.
      • getLoopNames

        default Set<String> getLoopNames()
        If this traverser supports loops then return the loop names if any.