org.jage.property.functions
Class SumFunction

java.lang.Object
  extended by org.jage.property.Property
      extended by org.jage.property.functions.PropertyFunction
          extended by org.jage.property.functions.NumericFunction
              extended by org.jage.property.functions.SumFunction

public class SumFunction
extends NumericFunction

Sum property function.

Author:
Tomek

Constructor Summary
SumFunction(String functionName, String argumentsPattern)
          Constructor.
 
Method Summary
protected  Object computeValue(List<FunctionArgument> arguments)
          Computes function's value.
protected  Class<?> getReturnType()
          Returns Double.class.
 
Methods inherited from class org.jage.property.functions.NumericFunction
getArgumentValue
 
Methods inherited from class org.jage.property.functions.PropertyFunction
getMetaProperty, getValue, setArgumentsResolver, setValue
 
Methods inherited from class org.jage.property.Property
addMonitor, getMonitoringStrategy, getSimpleProperty, initializeMonitoringStrategy, notifyMonitors, notifyMonitors, objectDeleted, removeMonitor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SumFunction

public SumFunction(String functionName,
                   String argumentsPattern)
Constructor.

Parameters:
functionName - name of the function.
argumentsPattern - pattern for arguments.
Method Detail

computeValue

protected Object computeValue(List<FunctionArgument> arguments)
                       throws InvalidFunctionArgumentException
Computes function's value. It returns sum of all arguments.

Specified by:
computeValue in class PropertyFunction
Parameters:
arguments - arguments for the function.
Returns:
value of the function.
Throws:
InvalidFunctionArgumentException - one of arguments is not valid.

getReturnType

protected Class<?> getReturnType()
Returns Double.class.

Specified by:
getReturnType in class PropertyFunction
Returns:
class for function's return value.


Copyright © 2006-2011 AGH University of Science and Technology. All Rights Reserved.