Interface Step<S,​E>

    • Method Detail

      • hasStarts

        boolean hasStarts()
        Determines if starts objects are present without iterating forward. This function has special applicability around ReducingBarrierStep implementations where they always return true for calls to Iterator.hasNext(). Using this function gives insight to what the step itself is holding in its iterator without performing any sort of processing on the step itself.
      • setPreviousStep

        void setPreviousStep​(Step<?,​S> step)
        Set the step that is previous to the current step. Used for linking steps together to form a function chain.
        Parameters:
        step - the previous step of this step
      • getPreviousStep

        Step<?,​S> getPreviousStep()
        Get the step prior to the current step.
        Returns:
        The previous step
      • setNextStep

        void setNextStep​(Step<E,​?> step)
        Set the step that is next to the current step. Used for linking steps together to form a function chain.
        Parameters:
        step - the next step of this step
      • getNextStep

        Step<E,​?> getNextStep()
        Get the next step to the current step.
        Returns:
        The next step
      • getTraversal

        <A,​B> Traversal.Admin<A,​B> getTraversal()
        Get the Traversal.Admin that this step is contained within.
        Type Parameters:
        A - The incoming object type of the traversal
        B - The outgoing object type of the traversal
        Returns:
        The traversal of this step
      • setTraversal

        void setTraversal​(Traversal.Admin<?,​?> traversal)
        Set the Traversal that this step is contained within.
        Parameters:
        traversal - the new traversal for this step
      • reset

        void reset()
        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.
      • clone

        Step<S,​E> clone()
        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 reset() is called. Moreover, the previous and next steps should be set to EmptyStep.
        Returns:
        The cloned step
      • getLabels

        Set<String> getLabels()
        Get the labels of this step. The labels are ordered by the order of the calls to addLabel(java.lang.String).
        Returns:
        the set of labels for this step
      • addLabel

        void addLabel​(String label)
        Add a label to this step.
        Parameters:
        label - the label to add to this step
      • removeLabel

        void removeLabel​(String label)
        Remove a label from this step.
        Parameters:
        label - the label to remove from this step
      • clearLabels

        void clearLabels()
        Removes all labels on the step.
      • setId

        void setId​(String id)
        Get the unique id of the step. These ids can change when strategies are applied and anonymous traversals are embedded in the parent traversal. A developer should typically not need to call this method.
        Parameters:
        id - the unique id of the step
      • getId

        String getId()
        Get the unique id of this step.
        Returns:
        the unique id of the step
      • getRequirements

        default Set<org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement> getRequirements()
        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.
        Returns:
        the set of requirements
      • equals

        default boolean equals​(Step other,
                               boolean compareIds)
        Compare the current step with another step.
        Parameters:
        other - the other step
        compareIds - whether to compare step IDs or not
        Returns:
        true if the steps are equal, otherwise false