org.geotools.filter.function
Class Collection_SumFunction

Object
  extended by ExpressionAbstract
      extended by DefaultExpression
          extended by FunctionExpressionImpl
              extended by Collection_SumFunction
All Implemented Interfaces:
Factory, ExpressionType, FunctionExpression, Expression, Function

public class Collection_SumFunction
extends FunctionExpressionImpl
implements FunctionExpression

Calculates the sum value of an attribute for a given FeatureCollection and Expression.

Since:
2.2M2
Author:
Cory Horner
Module:

Field Summary
 
Fields inherited from class FunctionExpressionImpl
fallback, name, params
 
Fields inherited from class DefaultExpression
expressionType, permissiveConstruction
 
Fields inherited from interface ExpressionType
ATTRIBUTE, ATTRIBUTE_DOUBLE, ATTRIBUTE_GEOMETRY, ATTRIBUTE_INTEGER, ATTRIBUTE_STRING, ATTRIBUTE_UNDECLARED, FUNCTION, LITERAL_DOUBLE, LITERAL_GEOMETRY, LITERAL_INTEGER, LITERAL_LONG, LITERAL_STRING, LITERAL_UNDECLARED, MATH_ADD, MATH_DIVIDE, MATH_MULTIPLY, MATH_SUBTRACT
 
Fields inherited from interface Expression
NIL
 
Fields inherited from interface Expression
NIL
 
Constructor Summary
Collection_SumFunction()
          Creates a new instance of Collection_SumFunction
 
Method Summary
 Object evaluate(Object feature)
          This method checks if the object is an instance of Feature and if so, calls through to #evaluate(Feature).
 int getArgCount()
          Gets the number of arguments that are set.
 void setExpression(Expression e)
           
 void setParameters(List args)
          The provided arguments are evaulated with respect to the FeatureCollection.
 
Methods inherited from class FunctionExpressionImpl
accept, equals, getArgs, getExpression, getFallbackValue, getImplementationHints, getName, getParameters, getType, setArgs, setFallbackValue, setName, toString
 
Methods inherited from class DefaultExpression
accept, evaluate, getValue, isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpression, isMathExpression
 
Methods inherited from class ExpressionAbstract
eval, eval, evaluate
 
Methods inherited from class Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface FunctionExpression
getArgs, getName, getType, setArgs
 
Methods inherited from interface Expression
accept, evaluate, getValue
 
Methods inherited from interface Expression
accept, evaluate
 
Methods inherited from interface Factory
getImplementationHints
 
Methods inherited from interface Function
getFallbackValue, getParameters
 
Methods inherited from interface Expression
accept, evaluate
 

Constructor Detail

Collection_SumFunction

public Collection_SumFunction()
Creates a new instance of Collection_SumFunction

Method Detail

getArgCount

public int getArgCount()
Description copied from class: FunctionExpressionImpl
Gets the number of arguments that are set.

Specified by:
getArgCount in interface FunctionExpression
Specified by:
getArgCount in class FunctionExpressionImpl
Returns:
the number of args.

setParameters

public void setParameters(List args)
The provided arguments are evaulated with respect to the FeatureCollection.

For an aggregate function (like sum) please use the WFS mandated XPath syntax to refer to featureMember content.

To refer to all 'X': featureMember/asterisk/X

Specified by:
setParameters in interface FunctionExpression
Overrides:
setParameters in class FunctionExpressionImpl
Parameters:
args - DOCUMENT ME!
Throws:
IllegalArgumentException - DOCUMENT ME!

evaluate

public Object evaluate(Object feature)
Description copied from class: DefaultExpression
This method checks if the object is an instance of Feature and if so, calls through to #evaluate(Feature). This is done to maintain backwards compatability with previous version of Expression api which depended on Feature. If the object is not an instance of feature the super implementation is called.

Specified by:
evaluate in interface Expression
Overrides:
evaluate in class DefaultExpression

setExpression

public void setExpression(Expression e)


Copyright © 1996-2009 Geotools. All Rights Reserved.