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

## Class FoldStep<S,E>

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

- All Implemented Interfaces:
    Serializable, Cloneable, Iterator<Traverser.Admin<E>>, Step<S,E>, Barrier<E>, Generating<E,E>, MemoryComputing<E>

      public final class FoldStep<S,E>
      extends ReducingBarrierStep<S,E>

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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FoldStep.FoldBiOperator<E>`

  - ### Field Summary

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep

      `reducingBiOperator, seedSupplier`

    - ### 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
    `FoldStep(Traversal.Admin traversal)`
    `FoldStep(Traversal.Admin traversal, Supplier<E> seed, BiFunction<E,S,E> foldFunction)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<TraverserRequirement>` | `getRequirements()` Provide the necessary `TraverserRequirement` that must be met by the traverser in order for the step to function properly.
    `boolean` | `isListFold()`
    `E` | `projectTraverser(Traverser.Admin<S> traverser)`

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

      `addBarrier, clone, done, getBiOperator, getMemoryComputeKey, getSeedSupplier, hasNextBarrier, nextBarrier, processAllStarts, processNextStart, reset, setReducingBiOperator, setSeedSupplier`

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

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

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

      `generateFinalResult`

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

      `equals`

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

      `forEachRemaining, remove`

- - ### Constructor Detail

    - #### FoldStep

          public FoldStep(Traversal.Admin traversal)

    - #### FoldStep

          public FoldStep(Traversal.Admin traversal,
                          Supplier<E> seed,
                          BiFunction<E,S,E> foldFunction)

  - ### Method Detail

    - #### projectTraverser

          public E projectTraverser(Traverser.Admin<S> traverser)

      Specified by:
        `projectTraverser` in class `ReducingBarrierStep<S,E>`

    - #### getRequirements

          public Set<TraverserRequirement> getRequirements()

      Description copied from interface: `Step`
      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

    - #### isListFold

          public boolean isListFold()

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