fr.expression4j.basic
Interface OperatorManager

All Known Implementing Classes:
OperatorManagerImpl

public interface OperatorManager


Method Summary
 void addOperatorImpl(OperatorImpl operatorImpl)
          Add an operator implementation to the manager.
 MathematicalElement computeValue(java.lang.String operatorName, MathematicalElement element)
          Eval an unary operator on given value.
 MathematicalElement computeValue(java.lang.String operatorName, MathematicalElement leftElement, MathematicalElement rightElement)
          Eval a binary operator on given values.
 java.lang.String getName()
          get operator manager name
 OperatorImpl getOperatorImpl(java.lang.String name)
          Get an operator impl.
 java.util.List getOperatorImplList()
          Get the list of operator impl.
 void removeOperatorImpl(OperatorImpl operatorImpl)
          Remove an operator implementation to the manager.
 

Method Detail

addOperatorImpl

void addOperatorImpl(OperatorImpl operatorImpl)
Add an operator implementation to the manager.

Parameters:
operatorImpl - operator to add.

removeOperatorImpl

void removeOperatorImpl(OperatorImpl operatorImpl)
Remove an operator implementation to the manager.

Parameters:
operatorImpl - operator to remove.

getOperatorImpl

OperatorImpl getOperatorImpl(java.lang.String name)
Get an operator impl.

Parameters:
name - operator impl to get.
Returns:
the operator impl if found. null otherwise.

getOperatorImplList

java.util.List getOperatorImplList()
Get the list of operator impl.

Returns:
list of operator impl as Sting.

computeValue

MathematicalElement computeValue(java.lang.String operatorName,
                                 MathematicalElement element)
                                 throws EvalException
Eval an unary operator on given value.

Parameters:
operatorName - operator to apply
element - value on wich apply the operator
Returns:
the evalued value.
Throws:
EvalException - if an error occurd (operator not define for the given element ...)

computeValue

MathematicalElement computeValue(java.lang.String operatorName,
                                 MathematicalElement leftElement,
                                 MathematicalElement rightElement)
                                 throws EvalException
Eval a binary operator on given values.

Parameters:
operatorName - operator to apply
leftElement - left value of operator
rightElement - right value of operator
Returns:
the evalued value
Throws:
EvalException - EvalException if an error occurd (operator not define for the given element ...)

getName

java.lang.String getName()
get operator manager name

Returns:
operator manager name