Package org.geotools.feature.visitor
Class MinVisitor
Object
MinVisitor
- All Implemented Interfaces:
FeatureVisitor
,FeatureAttributeVisitor
,FeatureCalc
Calculates the minimum value of an attribute.
- Since:
- 2.2.M2
- Author:
- Cory Horner, Refractions
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMinVisitor
(int attributeTypeIndex, SimpleFeatureType type) MinVisitor
(String attributeTypeName) MinVisitor
(String attrName, SimpleFeatureType type) MinVisitor
(Expression expr) -
Method Summary
Modifier and TypeMethodDescriptionList of expressions used by visitor.getMin()
Get the min value.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 minimum.
-
Constructor Details
-
MinVisitor
-
MinVisitor
- Throws:
IllegalFilterException
-
MinVisitor
- Throws:
IllegalFilterException
-
MinVisitor
- 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 minimum.- 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
-
getMin
Get the min value.- Returns:
- Minimum value
-
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
-
getExpression
-
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 'min', the value stored is of type 'Comparable'.
-