org.activemath.exercises.openmath.services
Class ArithmeticExpressionEvaluator

java.lang.Object
  extended by org.activemath.exercises.openmath.OpenMathService
      extended by org.activemath.exercises.openmath.services.ArithmeticExpressionEvaluator

public class ArithmeticExpressionEvaluator
extends OpenMathService

Arithmetic expression evaluator OpenMath service. Evaluates OpenMath expressions with arithmetic symbols in them, as double-precision floating point numbers.

Version:
$Revision: 1.13 $ $Date: 2008/11/25 14:24:39 $

Field Summary
 
Fields inherited from class org.activemath.exercises.openmath.OpenMathService
comparatorCD, comparatorName, context, expressionTransformer, om, xpathError, xpathHint, xpathQuit
 
Constructor Summary
ArithmeticExpressionEvaluator()
           
 
Method Summary
 org.jdom.Element evaluate(org.jdom.Element expressionOmobj, Map variables)
          Evaluate the expression, and return its value as the JDom tree of the OpenMath XML with the result.
static void main(String[] args)
           
 
Methods inherited from class org.activemath.exercises.openmath.OpenMathService
abort, console, evaluateEquivalence, selectContext, setComparator, setExpressionTransformer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArithmeticExpressionEvaluator

public ArithmeticExpressionEvaluator()
Method Detail

main

public static void main(String[] args)

evaluate

public org.jdom.Element evaluate(org.jdom.Element expressionOmobj,
                                 Map variables)
Evaluate the expression, and return its value as the JDom tree of the OpenMath XML with the result.

Overrides:
evaluate in class OpenMathService
Returns:
OMOBJ element (with OM namespace) containing the value.