Package org.geotools.feature.visitor
Class MedianVisitor
Object
MedianVisitor
- All Implemented Interfaces:
FeatureVisitor,FeatureAttributeVisitor,FeatureCalc
Calculates the median of an attribute in all features of a collection
- Since:
- 2.2.M2
- Author:
- Cory Horner, Refractions
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMedianVisitor(int attributeTypeIndex, SimpleFeatureType type) MedianVisitor(String attributeTypeName) MedianVisitor(String attrName, SimpleFeatureType type) MedianVisitor(Expression expr) -
Method Summary
Modifier and TypeMethodDescriptionList of expressions used by visitor.Return the median of all features in the collectionReturns 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.voidinit(SimpleFeatureCollection collection) voidreset()Reset the stored information about the median.voidsetValue(Comparable median) voidsetValue(List<Comparable> list) voidVisit the provided feature.voidvisit(SimpleFeature feature)
-
Constructor Details
-
MedianVisitor
-
MedianVisitor
- Throws:
IllegalFilterException
-
MedianVisitor
- Throws:
IllegalFilterException
-
MedianVisitor
- Throws:
IllegalFilterException
-
-
Method Details
-
init
-
getExpressions
Description copied from interface:FeatureAttributeVisitorList of expressions used by visitor.- Specified by:
getExpressionsin interfaceFeatureAttributeVisitor
-
getResultType
Description copied from interface:FeatureAttributeVisitorReturns the expected output type given the input type.- Specified by:
getResultTypein interfaceFeatureAttributeVisitor- Parameters:
inputTypes- The type of the input expressions
-
visit
-
visit
Description 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 interfaceFeatureVisitor
-
getExpression
-
getMedian
Return the median of all features in the collection -
reset
public void reset()Reset the stored information about the median. -
getResult
Description copied from interface:FeatureCalcReturns the result of the calculation as a handy object which can be merged and modified.- Specified by:
getResultin interfaceFeatureCalc- Returns:
- the results of the calculation
-
setValue
-
setValue
-