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

## Class GraphStep<S,E extends Element>

- java.lang.Object
- - org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep<S,E>
  - - org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep<S,E>

- All Implemented Interfaces:
    Serializable, AutoCloseable, Cloneable, Iterator<Traverser.Admin<E>>, Step<S,E>, Configuring, GraphComputing, Parameterizing
  Direct Known Subclasses:
    Neo4jGraphStep, TinkerGraphStep

      public class GraphStep<S,E extends Element>
      extends AbstractStep<S,E>
      implements GraphComputing, AutoCloseable, Configuring

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `done`
    `protected Object[]` | `ids`
    `protected boolean` | `isStart`
    `protected Supplier<Iterator<E>>` | `iteratorSupplier`
    `protected Parameters` | `parameters`
    `protected Class<E>` | `returnClass`

    - ### 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
    `GraphStep(Traversal.Admin traversal, Class<E> returnClass, boolean isStart, Object... ids)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addIds(Object... newIds)`
    `void` | `clearIds()`
    `void` | `close()` Attempts to close an underlying iterator if it is of type `CloseableIterator`.
    `void` | `configure(Object... keyValues)` Accept a configuration to the `Step`.
    `void` | `convertElementsToIds()`
    `Object[]` | `getIds()`
    `Parameters` | `getParameters()` Gets the parameters on the step.
    `Class<E>` | `getReturnClass()`
    `int` | `hashCode()`
    `boolean` | `isStartStep()`
    `static boolean` | `isStartStep(Step<?,?> step)`
    `void` | `onGraphComputer()` The step will be executing on a `GraphComputer`.
    `static boolean` | `processHasContainerIds(GraphStep<?,?> graphStep, HasContainer hasContainer)` Helper method for providers that want to "fold in" `HasContainer`'s based on id checking into the ids of the `GraphStep`.
    `protected Traverser.Admin<E>` | `processNextStart()`
    `void` | `reset()` Reset the state of the step such that it has no incoming starts.
    `boolean` | `returnsEdge()`
    `boolean` | `returnsVertex()`
    `void` | `setIteratorSupplier(Supplier<Iterator<E>> iteratorSupplier)`
    `String` | `toString()`

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

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

    - ### 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.GraphComputing

      `atMaster, atMaster`

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

      `equals, getRequirements`

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

      `forEachRemaining, remove`

- - ### Field Detail

    - #### parameters

          protected Parameters parameters

    - #### returnClass

          protected final Class<E extends Element> returnClass

    - #### ids

          protected Object[] ids

    - #### iteratorSupplier

          protected transient Supplier<Iterator<E extends Element>> iteratorSupplier

    - #### isStart

          protected boolean isStart

    - #### done

          protected boolean done

  - ### Constructor Detail

    - #### GraphStep

          public GraphStep(Traversal.Admin traversal,
                           Class<E> returnClass,
                           boolean isStart,
                           Object... ids)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractStep<S,E extends Element>`

    - #### getParameters

          public Parameters getParameters()

      Description copied from interface: `Parameterizing`
      Gets the parameters on the step.
      Specified by:
        `getParameters` in interface `Parameterizing`

    - #### configure

          public void configure(Object... keyValues)

      Description copied from interface: `Configuring`
      Accept a configuration to the `Step`. Note that this interface extends `Parameterizing` and so there is an expectation that the `Step` implementation will have a `Parameters` instance that will house any values passed to this method. Storing these configurations in `Parameters` is not a requirement however, IF the configuration is an expected option for the step and can be stored on a member field that can be accessed on the step by more direct means (i.e. like a getter method).
      Specified by:
        `configure` in interface `Configuring`

    - #### getReturnClass

          public Class<E> getReturnClass()

    - #### isStartStep

          public boolean isStartStep()

    - #### isStartStep

          public static boolean isStartStep(Step<?,?> step)

    - #### returnsVertex

          public boolean returnsVertex()

    - #### returnsEdge

          public boolean returnsEdge()

    - #### setIteratorSupplier

          public void setIteratorSupplier(Supplier<Iterator<E>> iteratorSupplier)

    - #### getIds

          public Object[] getIds()

    - #### addIds

          public void addIds(Object... newIds)

    - #### clearIds

          public void clearIds()

    - #### onGraphComputer

          public void onGraphComputer()

      Description copied from interface: `GraphComputing`
      The step will be executing on a `GraphComputer`.
      Specified by:
        `onGraphComputer` in interface `GraphComputing`

    - #### convertElementsToIds

          public void convertElementsToIds()

    - #### processNextStart

          protected Traverser.Admin<E> processNextStart()

      Specified by:
        `processNextStart` in class `AbstractStep<S,E extends Element>`

    - #### 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,E extends Element>`
      Overrides:
        `reset` in class `AbstractStep<S,E extends Element>`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `AbstractStep<S,E extends Element>`

    - #### close

          public void close()

      Attempts to close an underlying iterator if it is of type `CloseableIterator`. Graph providers may choose to return this interface containing their vertices and edges if there are expensive resources that might need to be released at some point.
      Specified by:
        `close` in interface `AutoCloseable`

    - #### processHasContainerIds

          public static boolean processHasContainerIds(GraphStep<?,?> graphStep,
                                                       HasContainer hasContainer)

      Helper method for providers that want to "fold in" `HasContainer`'s based on id checking into the ids of the `GraphStep`.
      Parameters:
        `graphStep` - the GraphStep to potentially `addIds(Object...)`.
        `hasContainer` - The `HasContainer` to check for id validation.
      Returns:
        true if the `HasContainer` updated ids and thus, was processed.

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