org.geotools.feature.visitor
Class AverageVisitor.AverageResult

java.lang.Object
  extended byorg.geotools.feature.visitor.AbstractCalcResult
      extended byorg.geotools.feature.visitor.AverageVisitor.AverageResult
All Implemented Interfaces:
CalcResult
Enclosing class:
AverageVisitor

public static class AverageVisitor.AverageResult
extends AbstractCalcResult


Constructor Summary
AverageVisitor.AverageResult(int newCount, java.lang.Object newSum)
           
AverageVisitor.AverageResult(java.lang.Object newAverageStrategy)
           
AverageVisitor.AverageResult(java.lang.Object newAverageStrategy, boolean isOptimized)
           
 
Method Summary
 int getCount()
          The count used to calculate the average
 java.lang.Object getResult()
           
 java.lang.Object getSum()
          The sum used to calculate the average
 java.lang.Object getValue()
          Actual answer
 boolean isCompatible(CalcResult targetResults)
          Determines if the target CalcResult object can be merged with this CalcResult object
 CalcResult merge(CalcResult resultsToAdd)
          Merges the contents of a CalcResult Object with another CalcResult Object.
 
Methods inherited from class org.geotools.feature.visitor.AbstractCalcResult
toArray, toDouble, toEnvelope, toFloat, toGeometry, toInt, toList, toLong, toMap, toPoint, toSet, toString, toStringArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AverageVisitor.AverageResult

public AverageVisitor.AverageResult(java.lang.Object newAverageStrategy)

AverageVisitor.AverageResult

public AverageVisitor.AverageResult(java.lang.Object newAverageStrategy,
                                    boolean isOptimized)

AverageVisitor.AverageResult

public AverageVisitor.AverageResult(int newCount,
                                    java.lang.Object newSum)
Method Detail

getResult

public java.lang.Object getResult()

getValue

public java.lang.Object getValue()
Description copied from interface: CalcResult
Actual answer

Specified by:
getValue in interface CalcResult
Overrides:
getValue in class AbstractCalcResult

getCount

public int getCount()
The count used to calculate the average

Returns:
the count, or -1 if unknown

getSum

public java.lang.Object getSum()
The sum used to calculate the average

Returns:

isCompatible

public boolean isCompatible(CalcResult targetResults)
Determines if the target CalcResult object can be merged with this CalcResult object

Specified by:
isCompatible in interface CalcResult
Overrides:
isCompatible in class AbstractCalcResult
Parameters:
targetResults - a second CalcResult object (target)
Returns:
boolean

merge

public CalcResult merge(CalcResult resultsToAdd)
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 interface CalcResult
Overrides:
merge in class AbstractCalcResult
Parameters:
resultsToAdd - the CalcResult to merge the results with
Returns:
a new merged CalcResult object
Throws:
java.lang.IllegalArgumentException - when the resultsToAdd are inappropriate


Copyright © GeoTools. All Rights Reserved.