Class XMLDatatypeMathUtil
- java.lang.Object
-
- org.eclipse.rdf4j.query.algebra.evaluation.util.XMLDatatypeMathUtil
-
public class XMLDatatypeMathUtil extends java.lang.ObjectA utility class for evaluation of extended "mathematical" expressions on RDF literals. They do not work only on numeric literals but also on durations
-
-
Constructor Summary
Constructors Constructor Description XMLDatatypeMathUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static LiteralbuildLiteral(javax.xml.datatype.Duration duration, ValueFactory vf)static Literalcompute(Literal leftLit, Literal rightLit, MathExpr.MathOp op)Computes the result of applying the supplied math operator on the supplied left and right operand.static Literalcompute(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.private static CoreDatatype.XSDgetDatatypeForDuration(javax.xml.datatype.Duration duration)private static LiteraloperationsBetweenCalendarAndDuration(Literal calendarLit, Literal durationLit, MathExpr.MathOp op, ValueFactory vf)private static LiteraloperationsBetweenDurationAndCalendar(Literal durationLit, Literal calendarLit, MathExpr.MathOp op, ValueFactory vf)private static LiteraloperationsBetweenDurationAndDecimal(Literal durationLit, Literal decimalLit, MathExpr.MathOp op, ValueFactory vf)private static LiteraloperationsBetweenDurations(Literal leftLit, Literal rightLit, MathExpr.MathOp op, ValueFactory vf)
-
-
-
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 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
-
operationsBetweenDurations
private static Literal operationsBetweenDurations(Literal leftLit, Literal rightLit, MathExpr.MathOp op, ValueFactory vf)
-
operationsBetweenDurationAndDecimal
private static Literal operationsBetweenDurationAndDecimal(Literal durationLit, Literal decimalLit, MathExpr.MathOp op, ValueFactory vf)
-
operationsBetweenCalendarAndDuration
private static Literal operationsBetweenCalendarAndDuration(Literal calendarLit, Literal durationLit, MathExpr.MathOp op, ValueFactory vf)
-
operationsBetweenDurationAndCalendar
private static Literal operationsBetweenDurationAndCalendar(Literal durationLit, Literal calendarLit, MathExpr.MathOp op, ValueFactory vf)
-
buildLiteral
private static Literal buildLiteral(javax.xml.datatype.Duration duration, ValueFactory vf)
-
getDatatypeForDuration
private static CoreDatatype.XSD getDatatypeForDuration(javax.xml.datatype.Duration duration)
-
-