Class AbstractAggregation
java.lang.Object
com.jayway.jsonpath.internal.function.numeric.AbstractAggregation
- All Implemented Interfaces:
PathFunction
- Direct Known Subclasses:
Average
,Max
,Min
,StandardDeviation
,Sum
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Number
getValue()
Obtains the value generated via the series of next value callsinvoke
(String currentPath, PathRef parent, Object model, EvaluationContext ctx) Invoke the function and output a JSON object (or scalar) value which will be the result of executing the pathprotected abstract void
Defines the next value in the array to the mathmatical function
-
Constructor Details
-
AbstractAggregation
public AbstractAggregation()
-
-
Method Details
-
next
Defines the next value in the array to the mathmatical function- Parameters:
value
- The numerical value to process next
-
getValue
Obtains the value generated via the series of next value calls- Returns:
- A numerical answer based on the input value provided
-
invoke
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 interfacePathFunction
- Parameters:
currentPath
- The current path location inclusive of the function nameparent
- The path location above the current functionmodel
- The JSON model as input to this particular functionctx
- Eval context, state bag used as the path is traversed, maintains the result of executing- Returns:
-