org.geotools.feature.visitor
Class SumVisitor

Object
  extended by SumVisitor
All Implemented Interfaces:
FeatureCalc, FeatureVisitor

public class SumVisitor
extends Object
implements FeatureCalc

Calculates the Sum of an attribute (of a FeatureVisitor)

Since:
2.2.M2
Author:
Cory Horner, Refractions
Module:
modules/library/main (gt-main.jar)

Nested Class Summary
static class SumVisitor.SumResult
           
 
Constructor Summary
SumVisitor(Expression expr)
           
SumVisitor(int attributeTypeIndex, SimpleFeatureType type)
           
SumVisitor(String attrName, SimpleFeatureType type)
           
 
Method Summary
 Expression getExpression()
           
 CalcResult getResult()
          Returns the result of the calculation as a handy object which can be merged and modified.
 Object getSum()
           
 void init(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
           
 void reset()
           
 void setValue(Object newSum)
           
 void visit(Feature feature)
           
 void visit(SimpleFeature feature)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SumVisitor

public SumVisitor(int attributeTypeIndex,
                  SimpleFeatureType type)
           throws IllegalFilterException
Throws:
IllegalFilterException

SumVisitor

public SumVisitor(String attrName,
                  SimpleFeatureType type)
           throws IllegalFilterException
Throws:
IllegalFilterException

SumVisitor

public SumVisitor(Expression expr)
           throws IllegalFilterException
Throws:
IllegalFilterException
Method Detail

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

getSum

public Object getSum()

setValue

public void setValue(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-2009 Geotools. All Rights Reserved.