org.jage.property.functions
Class AvgFunction
java.lang.Object
org.jage.property.Property
org.jage.property.functions.PropertyFunction
org.jage.property.functions.NumericFunction
org.jage.property.functions.AvgFunction
public class AvgFunction
- extends NumericFunction
Average property function.
- Author:
- Tomek
AvgFunction
public AvgFunction(String functionName,
String argumentsPattern,
double defaultValue)
- Constructor.
- Parameters:
functionName
- name of the function.argumentsPattern
- pattern for arguments.defaultValue
- default value, used when pattern is'n resolved to any arguments.
computeValue
protected Object computeValue(List<FunctionArgument> arguments)
throws InvalidFunctionArgumentException
- Computes function's value. It returns average of all it's 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.