org.geotools.feature.visitor
Class MedianVisitor
Object
MedianVisitor
- All Implemented Interfaces:
- FeatureCalc, FeatureVisitor
public class MedianVisitor
- extends Object
- implements FeatureCalc
Calculates the median of an attribute in all features of a collection
- Since:
- 2.2.M2
- Author:
- Cory Horner, Refractions
- Module:
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MedianVisitor
public MedianVisitor(String attributeTypeName)
MedianVisitor
public MedianVisitor(int attributeTypeIndex,
SimpleFeatureType type)
throws IllegalFilterException
- Throws:
IllegalFilterException
MedianVisitor
public MedianVisitor(String attrName,
SimpleFeatureType type)
throws IllegalFilterException
- Throws:
IllegalFilterException
MedianVisitor
public MedianVisitor(Expression expr)
throws IllegalFilterException
- Throws:
IllegalFilterException
init
public void init(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
visit
public void visit(SimpleFeature feature)
visit
public void visit(Feature feature)
- Specified by:
visit
in interface FeatureVisitor
getExpression
public Expression getExpression()
getMedian
public Object getMedian()
- Return the median of all features in the collection
reset
public void reset()
- Reset the stored information about the median.
getResult
public CalcResult 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 interface FeatureCalc
- Returns:
- the results of the calculation
setValue
public void setValue(List list)
setValue
public void setValue(Comparable median)
Copyright © 1996-2009 Geotools. All Rights Reserved.