org.apache.tinkerpop.gremlin.process.traversal.lambda

## Class ValueTraversal<T,V>

- java.lang.Object
- - org.apache.tinkerpop.gremlin.process.traversal.lambda.AbstractLambdaTraversal<T,V>
  - - org.apache.tinkerpop.gremlin.process.traversal.lambda.ValueTraversal<T,V>

- All Implemented Interfaces:
    Serializable, AutoCloseable, Cloneable, Iterator<V>, Traversal<T,V>, Traversal.Admin<T,V>

      public final class ValueTraversal<T,V>
      extends AbstractLambdaTraversal<T,V>

  More efficiently extracts a value from an `Element` or `Map` to avoid strategy application costs.
  Author:
    Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `Traversal.Admin<S,E>, Traversal.Exceptions, Traversal.Symbols`

  - ### Field Summary

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.lambda.AbstractLambdaTraversal

      `bypassTraversal`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValueTraversal(String propertyKey)` Creates an instance for the specified `propertyKey`.
    `ValueTraversal(String propertyKey, Traversal.Admin<T,V> bypassTraversal)` Creates an instance with the `bypassTraversal` set on construction.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addStart(Traverser.Admin<T> start)` Add a single `Traverser.Admin` object to the head of the traversal.
    `boolean` | `equals(Object other)`
    `String` | `getPropertyKey()`
    `V` | `getValue()` Gets the value of the `Traversal` which will be `null` until `addStart(Traverser.Admin)` is called.
    `int` | `hashCode()`
    `boolean` | `hasNext()` If there is a "start" traverser this method will return `true` and otherwise `false` and in either case will always return as such, irrespective of calls to `next()`.
    `boolean` | `isNoStarts()` Determines if there is a value to iterate from the `Traversal`.
    `V` | `next()` Return the `value` of the traverser and will continue to return it on subsequent calls.
    `void` | `reset()` Call the `Step.reset()` method on every step in the traversal.
    `String` | `toString()`

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.lambda.AbstractLambdaTraversal

      `addStep, applyStrategies, clone, getBypassTraversal, getBytecode, getGraph, getParent, getSideEffects, getSteps, getStrategies, getTraverserGenerator, getTraverserRequirements, isLocked, isRoot, nextTraverser, removeStep, setBypassTraversal, setGraph, setParent, setSideEffects, setStrategies`

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

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

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

      `addStarts, addStep, equals, getEndStep, getStartStep, getTraversalSource, getTraverserSetSupplier, removeStep`

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

      `asAdmin, close, explain, fill, forEachRemaining, forEachRemaining, iterate, next, none, notifyClose, profile, promise, toBulkSet, toList, toSet, toStream, tryNext`

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

      `remove`

- - ### Constructor Detail

    - #### ValueTraversal

          public ValueTraversal(String propertyKey)

      Creates an instance for the specified `propertyKey`.

    - #### ValueTraversal

          public ValueTraversal(String propertyKey,
                                Traversal.Admin<T,V> bypassTraversal)

      Creates an instance with the `bypassTraversal` set on construction.

  - ### Method Detail

    - #### getValue

          public V getValue()

      Gets the value of the `Traversal` which will be `null` until `addStart(Traverser.Admin)` is called.

    - #### isNoStarts

          public boolean isNoStarts()

      Determines if there is a value to iterate from the `Traversal`.

    - #### next

          public V next()

      Return the `value` of the traverser and will continue to return it on subsequent calls. Calling methods should account for this behavior on their own.
      Specified by:
        `next` in interface `Iterator<V>`
      Overrides:
        `next` in class `AbstractLambdaTraversal<T,V>`

    - #### hasNext

          public boolean hasNext()

      If there is a "start" traverser this method will return `true` and otherwise `false` and in either case will always return as such, irrespective of calls to `next()`. Calling methods should account for this behavior on their own.
      Specified by:
        `hasNext` in interface `Iterator<V>`
      Overrides:
        `hasNext` in class `AbstractLambdaTraversal<T,V>`

    - #### addStart

          public void addStart(Traverser.Admin<T> start)

      Description copied from interface: `Traversal.Admin`
      Add a single `Traverser.Admin` object to the head of the traversal. Users should typically not need to call this method. For dynamic inject of data, they should use `InjectStep`.
      Specified by:
        `addStart` in interface `Traversal.Admin<T,V>`
      Overrides:
        `addStart` in class `AbstractLambdaTraversal<T,V>`
      Parameters:
        `start` - a traverser to add to the traversal

    - #### getPropertyKey

          public String getPropertyKey()

    - #### reset

          public void reset()

      Description copied from interface: `Traversal.Admin`
      Call the `Step.reset()` method on every step in the traversal.
      Specified by:
        `reset` in interface `Traversal.Admin<T,V>`
      Overrides:
        `reset` in class `AbstractLambdaTraversal<T,V>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `AbstractLambdaTraversal<T,V>`

    - #### equals

          public boolean equals(Object other)

      Overrides:
        `equals` in class `AbstractLambdaTraversal<T,V>`

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