Package org.geotools.feature.visitor
Class AverageVisitor.AverageResult
Object
AbstractCalcResult
AverageResult
- All Implemented Interfaces:
CalcResult
- Enclosing class:
- AverageVisitor
-
Field Summary
Fields inherited from interface CalcResult
NULL_RESULT
-
Constructor Summary
ConstructorsConstructorDescriptionAverageResult
(int newCount, Object newSum) AverageResult
(Object value) AverageResult
(Object newAverageStrategy, boolean isOptimized) -
Method Summary
Modifier and TypeMethodDescriptionint
getCount()
The count used to calculate the averagegetSum()
The sum used to calculate the averagegetValue()
Actual answerboolean
isCompatible
(CalcResult targetResults) Determines if the target CalcResult object can be merged with this CalcResult objectmerge
(CalcResult resultsToAdd) Merges the contents of a CalcResult Object with another CalcResult Object.Methods inherited from class AbstractCalcResult
toArray, toDouble, toEnvelope, toFloat, toGeometry, toInt, toList, toLong, toMap, toPoint, toSet, toString, toStringArray
-
Constructor Details
-
AverageResult
-
AverageResult
-
AverageResult
-
-
Method Details
-
getResult
-
getValue
Description copied from interface:CalcResult
Actual answer- Specified by:
getValue
in interfaceCalcResult
- Overrides:
getValue
in classAbstractCalcResult
- Returns:
- the calculation result as a generic object
-
getCount
public int getCount()The count used to calculate the average- Returns:
- the count, or -1 if unknown
-
getSum
The sum used to calculate the average -
isCompatible
Determines if the target CalcResult object can be merged with this CalcResult object- Specified by:
isCompatible
in interfaceCalcResult
- Overrides:
isCompatible
in classAbstractCalcResult
- Parameters:
targetResults
- a second CalcResult object (target)- Returns:
- boolean
-
merge
Merges the contents of a CalcResult Object with another CalcResult Object. If the two CalcResult objects are compatible, the merged result (a new object) is returned.- Specified by:
merge
in interfaceCalcResult
- Overrides:
merge
in classAbstractCalcResult
- Parameters:
resultsToAdd
- the CalcResult to merge the results with- Returns:
- a new merged CalcResult object
- Throws:
IllegalArgumentException
- when the resultsToAdd are inappropriate
-