Class MeanGlobalStep<S extends Number,E extends Number>

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

public final class MeanGlobalStep<S extends Number,E extends Number> extends ReducingBarrierStep<S,E>
Author:
Marko A. Rodriguez (http://markorodriguez.com), Daniel Kuppitz (http://gremlin.guru)
See Also:
  • Constructor Details

  • Method Details

    • generateSeedFromStarts

      protected E generateSeedFromStarts()
      Advances the starts until a non-null value is found or simply returns null. In this way, an all null stream will result in null.
      Overrides:
      generateSeedFromStarts in class ReducingBarrierStep<S extends Number,E extends Number>
    • processAllStarts

      public void processAllStarts()
      Description copied from interface: Barrier
      Process all left traversers by do not yield the resultant output. This method is useful for steps like ReducingBarrierStep, where traversers can be processed "on the fly" and thus, reduce memory consumption.
      Specified by:
      processAllStarts in interface Barrier<S extends Number>
      Overrides:
      processAllStarts in class ReducingBarrierStep<S extends Number,E extends Number>
    • projectTraverser

      public E projectTraverser(Traverser.Admin<S> traverser)
      Specified by:
      projectTraverser in class ReducingBarrierStep<S extends Number,E extends Number>
    • 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
    • generateFinalResult

      public E generateFinalResult(E meanNumber)
      Description copied from interface: Generating
      Post-process the side-effect and return the post-processed side-effect. The default implementation is simply the identity function and returns the argument.
      Parameters:
      meanNumber - the pre-processed side-effect.
      Returns:
      the post-processed side-effect.