Package org.geotools.feature.visitor
Class SumVisitor.SumResult
- Object
-
- AbstractCalcResult
-
- SumResult
-
- All Implemented Interfaces:
CalcResult
- Enclosing class:
- SumVisitor
public static class SumVisitor.SumResult extends AbstractCalcResult
-
-
Field Summary
-
Fields inherited from interface CalcResult
NULL_RESULT
-
-
Constructor Summary
Constructors Constructor Description SumResult(Object value)SumResult(SumVisitor.SumStrategy newSum)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetValue()Actual answerbooleanisCompatible(CalcResult targetResults)Returns true if the target results is a compatible type with the current results, with compatible meaning that the two results may be merged.CalcResultmerge(CalcResult resultsToAdd)Returns the merged results of two CalcResult.-
Methods inherited from class AbstractCalcResult
toArray, toDouble, toEnvelope, toFloat, toGeometry, toInt, toList, toLong, toMap, toPoint, toSet, toString, toStringArray
-
-
-
-
Constructor Detail
-
SumResult
public SumResult(SumVisitor.SumStrategy newSum)
-
SumResult
public SumResult(Object value)
-
-
Method Detail
-
getValue
public Object getValue()
Description copied from interface:CalcResultActual answer- Specified by:
getValuein interfaceCalcResult- Overrides:
getValuein classAbstractCalcResult- Returns:
- the calculation result as a generic object
-
isCompatible
public boolean isCompatible(CalcResult targetResults)
Description copied from interface:CalcResultReturns true if the target results is a compatible type with the current results, with compatible meaning that the two results may be merged.- Specified by:
isCompatiblein interfaceCalcResult- Overrides:
isCompatiblein classAbstractCalcResult- Parameters:
targetResults- the second CalcResult Object- Returns:
- true if the targetResults can be merged with the current results
-
merge
public CalcResult merge(CalcResult resultsToAdd)
Description copied from interface:CalcResultReturns the merged results of two CalcResult. The way in which the results are merged is dependent on the type of the results added. A new instance is created containing the merged results.For example: merging two min functions would return the smaller of the two values; merging a count and a sum would return an average.
- Specified by:
mergein interfaceCalcResult- Overrides:
mergein classAbstractCalcResult- Returns:
- the merged results
-
-