Maths
Interface CompiledFunction

All Known Implementing Classes:
CompiledFunction.Add, CompiledFunction.Constant, CompiledFunction.Divide, CompiledFunction.Function, CompiledFunction.Multiply, CompiledFunction.Power, CompiledFunction.Subtract, CompiledFunction.Variable

public interface CompiledFunction

Represents a mahematical function, variable or constant

Version:
1.2

Nested Class Summary
static class CompiledFunction.Add
          The addition function
static class CompiledFunction.Constant
          Represents a constant
static class CompiledFunction.Divide
          The divide function
static class CompiledFunction.Function
          Represents an arbitary function defined in a FunctionParser
static class CompiledFunction.Multiply
          The multiply function
static class CompiledFunction.Power
          The power function
static class CompiledFunction.Subtract
          The subtract function
static class CompiledFunction.Variable
          Represents a variable - simply returns the value of the variable
 
Method Summary
 double compute(java.util.Map<java.lang.String,java.lang.Double> values)
          Computes the result of the function
 java.util.Set<java.lang.String> neededParams()
          Returns a list of variable that the function expects to be passed to it
 

Method Detail

compute

double compute(java.util.Map<java.lang.String,java.lang.Double> values)
               throws NoSuchVariable
Computes the result of the function

Parameters:
values - Map from variable name to value
Returns:
The value of the function
Throws:
NoSuchVariable - Thrown if values does not contain a needed variable

neededParams

java.util.Set<java.lang.String> neededParams()
Returns a list of variable that the function expects to be passed to it

Returns:
The list of variable names tyhat need to be passed