Package org.geotools.feature.visitor
Class SumVisitor
Object
SumVisitor
- All Implemented Interfaces:
FeatureVisitor
,FeatureAttributeVisitor
,FeatureCalc
- Direct Known Subclasses:
SumAreaVisitor
Calculates the Sum of an attribute (of a FeatureVisitor)
- Since:
- 2.2.M2
- Author:
- Cory Horner, Refractions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
protected static interface
-
Constructor Summary
ConstructorsConstructorDescriptionSumVisitor
(int attributeTypeIndex, SimpleFeatureType type) SumVisitor
(String attrName, SimpleFeatureType type) SumVisitor
(Expression expr) -
Method Summary
Modifier and TypeMethodDescriptionList of expressions used by visitor.Returns the result of the calculation as a handy object which can be merged and modified.getResultType
(List<Class> inputTypes) Returns the expected output type given the input type.getSum()
void
init
(SimpleFeatureCollection collection) void
reset()
protected void
setStrategy
(SumVisitor.SumStrategy strategy) void
void
Visit the provided feature.void
visit
(SimpleFeature feature)
-
Constructor Details
-
SumVisitor
- Throws:
IllegalFilterException
-
SumVisitor
- Throws:
IllegalFilterException
-
SumVisitor
- Throws:
IllegalFilterException
-
-
Method Details
-
setStrategy
-
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
-
getSum
-
setValue
-
reset
public void reset() -
getResult
Description copied from interface:FeatureCalc
Returns the result of the calculation as a handy object which can be merged and modified.- Specified by:
getResult
in interfaceFeatureCalc
- Returns:
- the results of the calculation
-