Package org.apache.felix.gogo.runtime
Class Expression.Function
- java.lang.Object
-
- org.apache.felix.gogo.runtime.Expression.Function
-
- Enclosing class:
- Expression
public abstract class Expression.Function extends java.lang.Object
Abstract definition of a supported expression function. A function is defined by a name, the number of parameters and the actual processing implementation.
-
-
Constructor Summary
Constructors Constructor Description Function(java.lang.String name, int numParams)
Creates a new function with given name and parameter count.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.math.BigDecimal
eval(java.util.List<java.math.BigDecimal> parameters)
Implementation for this function.java.math.BigDecimal
eval(java.util.Map<java.lang.String,java.lang.Object> variables, java.util.List<java.lang.Object> parameters)
java.lang.String
getName()
int
getNumParams()
java.lang.String
toString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getNumParams
public int getNumParams()
-
eval
public java.math.BigDecimal eval(java.util.Map<java.lang.String,java.lang.Object> variables, java.util.List<java.lang.Object> parameters)
-
eval
public abstract java.math.BigDecimal eval(java.util.List<java.math.BigDecimal> parameters)
Implementation for this function.- Parameters:
parameters
- Parameters will be passed by the expression evaluator as aList
ofBigDecimal
values.- Returns:
- The function must return a new
BigDecimal
value as a computing result.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-