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 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 and Description
`Function(String name, int numParams)` Creates a new function with given name and parameter count.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract BigDecimal` `eval(List<BigDecimal> parameters)` Implementation for this function.
`BigDecimal` `eval(Map<String,Object> variables, List<Object> parameters)`
`String` `getName()`
`int` `getNumParams()`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Function

    public Function(String name,
                    int numParams)

Creates a new function with given name and parameter count.

Parameters:
  `name` - The name of the function.
  `numParams` - The number of parameters for this function.

### Method Detail

#### getName

    public String getName()

#### getNumParams

    public int getNumParams()

#### eval

    public BigDecimal eval(Map<String,Object> variables,
                           List<Object> parameters)

#### eval

    public abstract BigDecimal eval(List<BigDecimal> parameters)

Implementation for this function.

Parameters:
  `parameters` - Parameters will be passed by the expression evaluator as a `List` of `BigDecimal` values.
Returns:
  The function must return a new `BigDecimal` value as a computing result.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`