Class XMLDatatypeMathUtil
java.lang.Object
org.eclipse.rdf4j.query.algebra.evaluation.util.XMLDatatypeMathUtil
A utility class for evaluation of extended "mathematical" expressions on RDF literals. They do not work only on
numeric literals but also on durations
- Author:
- Thomas Pellissier Tanon
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static Literal
compute
(Literal leftLit, Literal rightLit, MathExpr.MathOp op, ValueFactory vf) Computes the result of applying the supplied math operator on the supplied left and right operand.
-
Constructor Details
-
XMLDatatypeMathUtil
public XMLDatatypeMathUtil()
-
-
Method Details
-
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 datatype literalrightLit
- a datatype literalop
- a mathematical operator, as definied by MathExpr.MathOp.vf
- a ValueFactory used to create the result- Returns:
- a datatype literal
- Throws:
ValueExprEvaluationException
-
compute
public static Literal compute(Literal leftLit, Literal rightLit, MathExpr.MathOp op, ValueFactory vf) throws ValueExprEvaluationException Computes the result of applying the supplied math operator on the supplied left and right operand.- Parameters:
leftLit
- a datatype literalrightLit
- a datatype literalop
- a mathematical operator, as definied by MathExpr.MathOp.- Returns:
- a datatype literal
- Throws:
ValueExprEvaluationException
-