org.geotools.feature.visitor
Class SumVisitor

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

public class SumVisitor
extends java.lang.Object
implements FeatureCalc

Calculates the Sum of an attribute (of a FeatureVisitor)

Since:
2.2.M2
Author:
Cory Horner, Refractions

Nested Class Summary
static class SumVisitor.SumResult
           
 
Constructor Summary
SumVisitor(org.opengis.filter.expression.Expression expr)
           
SumVisitor(int attributeTypeIndex, org.opengis.feature.simple.SimpleFeatureType type)
           
SumVisitor(java.lang.String attrName, org.opengis.feature.simple.SimpleFeatureType type)
           
 
Method Summary
 org.opengis.filter.expression.Expression getExpression()
           
 CalcResult getResult()
          Returns the result of the calculation as a handy object which can be merged and modified.
 java.lang.Object getSum()
           
 void init(FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> collection)
           
 void reset()
           
 void setValue(java.lang.Object newSum)
           
 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

SumVisitor

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

SumVisitor

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

SumVisitor

public SumVisitor(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()

getSum

public java.lang.Object getSum()

setValue

public void setValue(java.lang.Object newSum)

reset

public void reset()

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


Copyright © 1996-2010 Geotools. All Rights Reserved.