Class AbstractAggregation

  • All Implemented Interfaces:
    PathFunction
    Direct Known Subclasses:
    Average, Max, Min, StandardDeviation, Sum

    public abstract class AbstractAggregation
    extends java.lang.Object
    implements PathFunction
    Defines the pattern for processing numerical values via an abstract implementation that iterates over the collection of JSONArray entities and verifies that each is a numerical value and then passes that along the abstract methods Created by mattg on 6/26/15.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract java.lang.Number getValue()
      Obtains the value generated via the series of next value calls
      java.lang.Object invoke​(java.lang.String currentPath, PathRef parent, java.lang.Object model, EvaluationContext ctx)
      Invoke the function and output a JSON object (or scalar) value which will be the result of executing the path
      protected abstract void next​(java.lang.Number value)
      Defines the next value in the array to the mathmatical function
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractAggregation

        public AbstractAggregation()
    • Method Detail

      • next

        protected abstract void next​(java.lang.Number value)
        Defines the next value in the array to the mathmatical function
        Parameters:
        value - The numerical value to process next
      • getValue

        protected abstract java.lang.Number getValue()
        Obtains the value generated via the series of next value calls
        Returns:
        A numerical answer based on the input value provided
      • invoke

        public java.lang.Object invoke​(java.lang.String currentPath,
                                       PathRef parent,
                                       java.lang.Object model,
                                       EvaluationContext ctx)
        Description copied from interface: PathFunction
        Invoke the function and output a JSON object (or scalar) value which will be the result of executing the path
        Specified by:
        invoke in interface PathFunction
        Parameters:
        currentPath - The current path location inclusive of the function name
        parent - The path location above the current function
        model - The JSON model as input to this particular function
        ctx - Eval context, state bag used as the path is traversed, maintains the result of executing
        Returns: