org.openrdf.query.algebra.evaluation.util
Class MathUtil

java.lang.Object
  extended by org.openrdf.query.algebra.evaluation.util.MathUtil

public class MathUtil
extends Object

A utility class for evaluation of mathematical expressions on RDF literals.

Author:
Jeen Broekstra

Constructor Summary
MathUtil()
           
 
Method Summary
static Literal compute(Literal leftLit, Literal rightLit, MathExpr.MathOp op)
          Computes the result of applying the supplied math operator on the supplied left and right operand.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MathUtil

public MathUtil()
Method Detail

compute

public static Literal compute(Literal leftLit,
                              Literal rightLit,
                              MathExpr.MathOp op)
                       throws ValueExprEvaluationException
Computes the result of applying the supplied math operator on the supplied left and right operand.

Parameters:
leftLit - a numeric datatype literal
rightLit - a numeric datatype literal
op - a mathematical operator, as definied by MathExpr.MathOp.
Returns:
a numeric datatype literal containing the result of the operation. The result will be datatype according to the most specific data type the two operands have in common per the SPARQL/XPath spec.
Throws:
ValueExprEvaluationException


Copyright © 2001-2012 Aduna. All Rights Reserved.