Package org.geotools.feature.visitor
Class AverageVisitor
Object
AverageVisitor
- All Implemented Interfaces:
- FeatureVisitor,- FeatureAttributeVisitor,- FeatureCalc
Calculates the Average
- Since:
- 2.2.M2
- Author:
- Cory Horner, Refractions
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionAverageVisitor(int attributeTypeIndex, SimpleFeatureType type) Constructor class for the AverageVisitor using AttributeDescriptor IDAverageVisitor(String attrName, SimpleFeatureType type) Constructor class for the AverageVisitor using AttributeDescriptor NameAverageVisitor(Expression expr) Constructor class for the AverageVisitor using an expression
- 
Method SummaryModifier and TypeMethodDescriptionReturns the average from the visitor's currentList of expressions used by visitor.Returns a CalcResult object (containing the Average)getResultType(List<Class> inputTypes) Returns the expected output type given the input type.voidinit(SimpleFeatureCollection collection) voidreset()Resets the "Average" strategy patternvoidvoidvoidVisit the provided feature.voidvisit(SimpleFeature feature) 
- 
Constructor Details- 
AverageVisitorConstructor class for the AverageVisitor using AttributeDescriptor ID- Parameters:
- attributeTypeIndex- integer representing the AttributeDescriptor
- type- FeatureType
- Throws:
- IllegalFilterException
 
- 
AverageVisitorConstructor class for the AverageVisitor using AttributeDescriptor Name- Parameters:
- attrName- string respresenting the AttributeDescriptor
- type- FeatureType
- Throws:
- IllegalFilterException
 
- 
AverageVisitorConstructor class for the AverageVisitor using an expression- Throws:
- IllegalFilterException
 
 
- 
- 
Method Details- 
init
- 
getExpressionsDescription copied from interface:FeatureAttributeVisitorList of expressions used by visitor.- Specified by:
- getExpressionsin interface- FeatureAttributeVisitor
 
- 
getResultTypeDescription copied from interface:FeatureAttributeVisitorReturns the expected output type given the input type.- Specified by:
- getResultTypein interface- FeatureAttributeVisitor
- Parameters:
- inputTypes- The type of the input expressions
 
- 
visit
- 
visitDescription copied from interface:FeatureVisitorVisit the provided feature.Please consult the documentation for the FeatureCollection you are visiting to learn more - the provided feature may be invalid, or read only. - Specified by:
- visitin interface- FeatureVisitor
 
- 
getExpression
- 
getAverageReturns the average from the visitor's current- Returns:
- the average
 
- 
resetpublic void reset()Resets the "Average" strategy pattern
- 
getResultReturns a CalcResult object (containing the Average)- Specified by:
- getResultin interface- FeatureCalc
- Returns:
- the results of the calculation
 
- 
setValue
- 
setValue
 
-