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 Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAverageVisitor
(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 Summary
Modifier 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.void
init
(SimpleFeatureCollection collection) void
reset()
Resets the "Average" strategy patternvoid
void
void
Visit the provided feature.void
visit
(SimpleFeature feature)
-
Constructor Details
-
AverageVisitor
Constructor class for the AverageVisitor using AttributeDescriptor ID- Parameters:
attributeTypeIndex
- integer representing the AttributeDescriptortype
- FeatureType- Throws:
IllegalFilterException
-
AverageVisitor
Constructor class for the AverageVisitor using AttributeDescriptor Name- Parameters:
attrName
- string respresenting the AttributeDescriptortype
- FeatureType- Throws:
IllegalFilterException
-
AverageVisitor
Constructor class for the AverageVisitor using an expression- Throws:
IllegalFilterException
-
-
Method Details
-
init
-
getExpressions
Description copied from interface:FeatureAttributeVisitor
List of expressions used by visitor.- Specified by:
getExpressions
in interfaceFeatureAttributeVisitor
-
getResultType
Description copied from interface:FeatureAttributeVisitor
Returns the expected output type given the input type.- Specified by:
getResultType
in interfaceFeatureAttributeVisitor
- Parameters:
inputTypes
- The type of the input expressions
-
visit
-
visit
Description copied from interface:FeatureVisitor
Visit 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:
visit
in interfaceFeatureVisitor
-
getExpression
-
getAverage
Returns the average from the visitor's current- Returns:
- the average
-
reset
public void reset()Resets the "Average" strategy pattern -
getResult
Returns a CalcResult object (containing the Average)- Specified by:
getResult
in interfaceFeatureCalc
- Returns:
- the results of the calculation
-
setValue
-
setValue
-