Package edu.caltech.nanodb.functions
Class SimpleFunction
java.lang.Object
edu.caltech.nanodb.functions.Function
edu.caltech.nanodb.functions.ScalarFunction
edu.caltech.nanodb.functions.SimpleFunction
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
Abs,ArcCos,ArcSin,ArcTan,ArcTan2,Ceil,Coalesce,Concat,Cos,Extract,Floor,Greatest,If,IfNull,Least,NullIf,Pow,ReadPerfCounter,ResetPerfCounter,Round,Sin,Sqrt,Substring,Tan
This class provides the general abstraction for simple scalar functions,
which take zero or more arguments, and produce a single scalar result
based on these inputs. The function's results may be deterministic or
non-deterministic.
- To Do:
- (donnie) Would be nice to provide an "is deterministic" flag on functions so that expressions including deterministic functions may be simplified.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Objectevaluate(Environment env, List<Expression> args) Evaluates the function.Methods inherited from class edu.caltech.nanodb.functions.ScalarFunction
getReturnType
-
Constructor Details
-
SimpleFunction
public SimpleFunction()
-
-
Method Details
-
evaluate
Evaluates the function. Should be called at runtime for every function call.- Parameters:
env- Environment, in which the arguments are evaluatedargs- Arguments for this function- Returns:
- The value of the function
- Throws:
ExpressionException- when there is a problem with the evaluation like wrong number of arguments.
-