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>, GraphComputing
  Direct Known Subclasses:
    Neo4jGraphStep, TinkerGraphStep

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

  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 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` | `convertElementsToIds()`
    `Object[]` | `getIds()`
    `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, getTraversal, hasNext, next, 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

    - #### 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>`

    - #### 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–2019 Apache Software Foundation. All rights reserved.