Package org.geotools.feature.visitor
Class MaxVisitor
Object
MaxVisitor
- All Implemented Interfaces:
FeatureVisitor
,FeatureAttributeVisitor
,FeatureCalc
Calculates the maximum value of an attribute.
- Since:
- 2.2.M2
- Author:
- Cory Horner, Refractions Research Inc.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMaxVisitor
(int attributeTypeIndex, SimpleFeatureType type) MaxVisitor
(String attributeTypeName) MaxVisitor
(String attrName, SimpleFeatureType type) MaxVisitor
(Expression expr) -
Method Summary
Modifier and TypeMethodDescriptionList of expressions used by visitor.getMax()
Get the max value.int
int
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.void
init
(SimpleFeatureCollection collection) void
reset()
void
Overwrites the result stored by the visitor.void
Visit the provided feature.void
visit
(SimpleFeature feature) Visitor function, which looks at each feature and finds the maximum.
-
Constructor Details
-
MaxVisitor
-
MaxVisitor
- Throws:
IllegalFilterException
-
MaxVisitor
- Throws:
IllegalFilterException
-
MaxVisitor
- 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
Visitor function, which looks at each feature and finds the maximum.- Parameters:
feature
- the feature to be visited
-
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
-
getMax
Get the max value.- Returns:
- Max value
-
getNaNCount
public int getNaNCount()- Returns:
- the number of features which returned a NaN
-
getNullCount
public int getNullCount()- Returns:
- the number of features which returned a null
-
reset
public void reset() -
getExpression
-
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
-
setValue
Overwrites the result stored by the visitor. This should only be used by optimizations which will tell the visitor the answer rather than visiting all features.For 'max', the value stored is of type 'Comparable'.
-