public abstract class Function extends LazyFunction
Constructor and Description |
---|
Function(Expression exp,
java.lang.String name,
int numParams)
Creates a new function with given name and parameter count.
|
Modifier and Type | Method and Description |
---|---|
void |
cacheFuncValue(java.lang.String key,
java.lang.Double value) |
java.math.BigDecimal |
eval(java.util.List<java.math.BigDecimal> parameters)
Implementation for this function.
|
java.lang.Double |
getCachedFuncValue(java.lang.String key) |
java.lang.Exception |
getFuncError() |
java.lang.String |
getStringValForHashCode(java.math.BigDecimal hashCode) |
boolean |
hasCachedFuncValue(java.lang.String key) |
LazyNumber |
lazyEval(java.util.List<LazyNumber> lazyParams)
Implementation for this function.
|
void |
setFuncError(java.lang.Exception e) |
void |
validateSignature(java.lang.Integer expectedArgs,
java.util.List actArgs) |
getExpression, getName, getNumParams, numParamsVaries
public Function(Expression exp, java.lang.String name, int numParams)
name
- The name of the function.numParams
- The number of parameters for this function.public void validateSignature(java.lang.Integer expectedArgs, java.util.List actArgs)
public LazyNumber lazyEval(java.util.List<LazyNumber> lazyParams)
LazyFunction
lazyEval
in class LazyFunction
BigDecimal
value as a
computing result.public java.lang.Double getCachedFuncValue(java.lang.String key)
public void cacheFuncValue(java.lang.String key, java.lang.Double value)
public boolean hasCachedFuncValue(java.lang.String key)
public java.lang.String getStringValForHashCode(java.math.BigDecimal hashCode)
public java.math.BigDecimal eval(java.util.List<java.math.BigDecimal> parameters)
parameters
- Parameters will be passed by the expression evaluator as a
List
of BigDecimal
values.BigDecimal
value as a
computing result.java.lang.Exception
public java.lang.Exception getFuncError()
public void setFuncError(java.lang.Exception e)