org.geotools.feature.visitor
Class SumVisitor

java.lang.Object
  extended byorg.geotools.feature.visitor.SumVisitor
All Implemented Interfaces:
FeatureCalc, 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(Expression expr)
           
SumVisitor(int attributeTypeIndex, FeatureType type)
           
SumVisitor(java.lang.String attrName, FeatureType type)
           
 
Method Summary
 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 reset()
           
 void setValue(java.lang.Object newSum)
           
 void visit(Feature 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,
                  FeatureType type)
           throws IllegalFilterException

SumVisitor

public SumVisitor(java.lang.String attrName,
                  FeatureType type)
           throws IllegalFilterException

SumVisitor

public SumVisitor(Expression expr)
           throws IllegalFilterException
Method Detail

visit

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

getExpression

public 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 © GeoTools. All Rights Reserved.