org.geotools.feature.visitor
Class MedianVisitor

java.lang.Object
  extended by org.geotools.feature.visitor.MedianVisitor
All Implemented Interfaces:
FeatureCalc, org.opengis.feature.FeatureVisitor

public class MedianVisitor
extends java.lang.Object
implements FeatureCalc

Calculates the median of an attribute in all features of a collection

Since:
2.2.M2
Author:
Cory Horner, Refractions

Nested Class Summary
static class MedianVisitor.MedianResult
           
 
Constructor Summary
MedianVisitor(org.opengis.filter.expression.Expression expr)
           
MedianVisitor(int attributeTypeIndex, org.opengis.feature.simple.SimpleFeatureType type)
           
MedianVisitor(java.lang.String attributeTypeName)
           
MedianVisitor(java.lang.String attrName, org.opengis.feature.simple.SimpleFeatureType type)
           
 
Method Summary
 org.opengis.filter.expression.Expression getExpression()
           
 java.lang.Object getMedian()
          Return the median of all features in the collection
 CalcResult getResult()
          Returns the result of the calculation as a handy object which can be merged and modified.
 void init(FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> collection)
           
 void reset()
          Reset the stored information about the median.
 void setValue(java.lang.Comparable median)
           
 void setValue(java.util.List list)
           
 void visit(org.opengis.feature.Feature feature)
           
 void visit(org.opengis.feature.simple.SimpleFeature feature)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MedianVisitor

public MedianVisitor(java.lang.String attributeTypeName)

MedianVisitor

public MedianVisitor(int attributeTypeIndex,
                     org.opengis.feature.simple.SimpleFeatureType type)
              throws IllegalFilterException
Throws:
IllegalFilterException

MedianVisitor

public MedianVisitor(java.lang.String attrName,
                     org.opengis.feature.simple.SimpleFeatureType type)
              throws IllegalFilterException
Throws:
IllegalFilterException

MedianVisitor

public MedianVisitor(org.opengis.filter.expression.Expression expr)
              throws IllegalFilterException
Throws:
IllegalFilterException
Method Detail

init

public void init(FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> collection)

visit

public void visit(org.opengis.feature.simple.SimpleFeature feature)

visit

public void visit(org.opengis.feature.Feature feature)
Specified by:
visit in interface org.opengis.feature.FeatureVisitor

getExpression

public org.opengis.filter.expression.Expression getExpression()

getMedian

public java.lang.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(java.util.List list)

setValue

public void setValue(java.lang.Comparable median)


Copyright © 1996-2010 Geotools. All Rights Reserved.