public abstract class NodeValue extends ExprNode
Modifier and Type | Field and Description |
---|---|
static BigDecimal |
DecimalZERO |
static NodeValue |
FALSE |
static BigInteger |
IntegerZERO |
static NodeValue |
nvEmptyString |
static NodeValue |
nvINF |
static NodeValue |
nvNaN |
static NodeValue |
nvNegINF |
static NodeValue |
nvNothing |
static NodeValue |
nvONE |
static NodeValue |
nvZERO |
static NodeValue |
TRUE |
static boolean |
VerboseExceptions |
static boolean |
VerboseWarnings |
static DatatypeFactory |
xmlDatatypeFactory |
static String |
xsdNamespace |
CMP_EQUAL, CMP_GREATER, CMP_INDETERMINATE, CMP_LESS, CMP_UNEQUAL
Modifier and Type | Method and Description |
---|---|
Expr |
apply(ExprTransform transform) |
Expr |
applyNodeTransform(NodeTransform transform)
Rewrite, applying a node->node transformation
|
Node |
asNode() |
String |
asQuotedString() |
String |
asQuotedString(SerializationContext context) |
String |
asString() |
String |
asUnquotedString() |
static NodeValue |
booleanReturn(boolean b) |
static ValueSpaceClassification |
classifyValueOp(NodeValue nv1,
NodeValue nv2) |
static int |
compare(NodeValue nv1,
NodeValue nv2)
Compare by value (and only value) if possible.
|
static int |
compareAlways(NodeValue nv1,
NodeValue nv2)
Compare by value if possible else compare by kind/type/lexical form
Only use when you want an ordering regardless of form of NodeValue,
for example in ORDER BY
|
Expr |
copySubstitute(Binding binding)
Deep copy with substitution
|
boolean |
equals(Object other) |
NodeValue |
eval(Binding binding,
FunctionEnv env)
Evaluate this expression against the binding
|
Node |
evalNode(Binding binding,
ExecutionContext execCxt) |
boolean |
getBoolean() |
NodeValue |
getConstant()
NodeValue constant (returns null if not a constant)
|
String |
getDatatypeURI() |
XMLGregorianCalendar |
getDateTime() |
BigDecimal |
getDecimal() |
double |
getDouble() |
Duration |
getDuration() |
float |
getFloat() |
BigInteger |
getInteger() |
Node |
getNode()
getNode - return the node form - may be null (use .asNode() to force to a node)
|
String |
getString() |
ValueSpaceClassification |
getValueSpace() |
boolean |
hasDateTime() |
int |
hashCode() |
boolean |
hasNode() |
boolean |
isBlank() |
boolean |
isBoolean() |
boolean |
isConstant()
Answer whether this is a constant expression - false includes "don't know"
No constant folding so "false" from an expression that evaluates to a constant
|
boolean |
isDate() |
boolean |
isDateTime() |
boolean |
isDecimal() |
boolean |
isDouble() |
boolean |
isDuration() |
boolean |
isFloat() |
boolean |
isGDay() |
boolean |
isGMonth() |
boolean |
isGMonthDay() |
boolean |
isGYear() |
boolean |
isGYearMonth() |
boolean |
isInteger() |
boolean |
isIRI() |
boolean |
isLiteral() |
boolean |
isNumber() |
boolean |
isString() |
boolean |
isTime() |
boolean |
isYearMonth() |
static NodeValue |
makeBoolean(boolean b) |
static NodeValue |
makeDate(Calendar cal) |
static NodeValue |
makeDate(String lexicalForm) |
static NodeValue |
makeDate(XMLGregorianCalendar cal) |
static NodeValue |
makeDateTime(Calendar cal) |
static NodeValue |
makeDateTime(String lexicalForm) |
static NodeValue |
makeDateTime(XMLGregorianCalendar cal) |
static NodeValue |
makeDecimal(BigDecimal d) |
static NodeValue |
makeDecimal(double d) |
static NodeValue |
makeDecimal(long i) |
static NodeValue |
makeDecimal(String lexicalForm) |
static NodeValue |
makeDouble(double d) |
static NodeValue |
makeDuration(Duration duration) |
static NodeValue |
makeDuration(String lexicalForm) |
static NodeValue |
makeFloat(float f) |
static NodeValue |
makeInteger(BigInteger i) |
static NodeValue |
makeInteger(long i) |
static NodeValue |
makeInteger(String lexicalForm) |
static NodeValue |
makeNode(Node n) |
static NodeValue |
makeNode(String lexicalForm,
RDFDatatype dtype) |
static NodeValue |
makeNode(String lexicalForm,
String langTag,
Node datatype) |
static NodeValue |
makeNode(String lexicalForm,
String langTag,
String datatype) |
static NodeValue |
makeNodeBoolean(boolean b) |
static NodeValue |
makeNodeBoolean(String lexicalForm) |
static NodeValue |
makeNodeDate(Calendar date) |
static NodeValue |
makeNodeDate(String lexicalForm) |
static NodeValue |
makeNodeDateTime(Calendar date) |
static NodeValue |
makeNodeDateTime(String lexicalForm) |
static NodeValue |
makeNodeDecimal(BigDecimal decimal) |
static NodeValue |
makeNodeDecimal(String lexicalForm) |
static NodeValue |
makeNodeDouble(double v) |
static NodeValue |
makeNodeDouble(String lexicalForm) |
static NodeValue |
makeNodeDuration(Duration duration,
Node node) |
static NodeValue |
makeNodeFloat(float f) |
static NodeValue |
makeNodeFloat(String lexicalForm) |
static NodeValue |
makeNodeInteger(long v) |
static NodeValue |
makeNodeInteger(String lexicalForm) |
static NodeValue |
makeNodeString(String string) |
static NodeValue |
makeString(String s) |
static boolean |
notSameAs(Node n1,
Node n2)
Return true if the two Nodes are known to be different,
return false if the two Nodes are known to be the same,
else throw ExprEvalException
|
static boolean |
notSameAs(NodeValue nv1,
NodeValue nv2)
Return true if the two NodeValues are known to be different,
return false if the two NodeValues are known to be the same,
else throw ExprEvalException
|
static NodeValue |
parse(String string)
Convenience operation - parse a string to produce a NodeValue - common namespaces like xsd: are built-in
|
static void |
raise(ExprException ex) |
static boolean |
sameAs(NodeValue nv1,
NodeValue nv2)
Return true if the two NodeValues are known to be the same value
return false if known to be different values,
throw ExprEvalException otherwise
|
static Node |
toNode(NodeValue nv) |
String |
toString() |
void |
visit(ExprVisitor visitor) |
abstract void |
visit(NodeValueVisitor visitor) |
asVar, deepCopy, getExpr, getExprVar, getFunction, getGraphPattern, getVarName, getVarNamesMentioned, getVarsMentioned, isExpr, isFunction, isGraphPattern, isSatisfied, isVariable, varNamesMentioned, varsMentioned
public static boolean VerboseWarnings
public static boolean VerboseExceptions
public static final BigInteger IntegerZERO
public static final BigDecimal DecimalZERO
public static final NodeValue TRUE
public static final NodeValue FALSE
public static final NodeValue nvZERO
public static final NodeValue nvONE
public static final NodeValue nvNaN
public static final NodeValue nvINF
public static final NodeValue nvNegINF
public static final NodeValue nvEmptyString
public static final NodeValue nvNothing
public static final String xsdNamespace
public static DatatypeFactory xmlDatatypeFactory
public static NodeValue parse(String string)
public static NodeValue makeInteger(long i)
public static NodeValue makeInteger(BigInteger i)
public static NodeValue makeFloat(float f)
public static NodeValue makeDouble(double d)
public static NodeValue makeDecimal(BigDecimal d)
public static NodeValue makeDecimal(long i)
public static NodeValue makeDecimal(double d)
public static NodeValue makeDateTime(XMLGregorianCalendar cal)
public static NodeValue makeDate(XMLGregorianCalendar cal)
public static NodeValue makeBoolean(boolean b)
public static NodeValue booleanReturn(boolean b)
public static NodeValue makeNode(String lexicalForm, RDFDatatype dtype)
public static NodeValue makeNodeBoolean(boolean b)
public static NodeValue makeNodeInteger(long v)
public static NodeValue makeNodeFloat(float f)
public static NodeValue makeNodeDouble(double v)
public static NodeValue makeNodeDecimal(BigDecimal decimal)
public NodeValue eval(Binding binding, FunctionEnv env)
Expr
public Expr copySubstitute(Binding binding)
Expr
copySubstitute
in interface Expr
copySubstitute
in class ExprNode
public Expr applyNodeTransform(NodeTransform transform)
Expr
applyNodeTransform
in interface Expr
applyNodeTransform
in class ExprNode
public Node evalNode(Binding binding, ExecutionContext execCxt)
public boolean isConstant()
Expr
isConstant
in interface Expr
isConstant
in class ExprNode
public NodeValue getConstant()
Expr
getConstant
in interface Expr
getConstant
in class ExprNode
public boolean isIRI()
public boolean isBlank()
public static boolean sameAs(NodeValue nv1, NodeValue nv2)
public static boolean notSameAs(Node n1, Node n2)
public static boolean notSameAs(NodeValue nv1, NodeValue nv2)
public static int compareAlways(NodeValue nv1, NodeValue nv2)
nv1
- nv2
- public static int compare(NodeValue nv1, NodeValue nv2)
nv1
- nv2
- ExprNotComparableException
public static ValueSpaceClassification classifyValueOp(NodeValue nv1, NodeValue nv2)
public ValueSpaceClassification getValueSpace()
public final Node asNode()
public Node getNode()
public String getDatatypeURI()
public boolean hasNode()
public boolean isBoolean()
public boolean isString()
public boolean isNumber()
public boolean isInteger()
public boolean isDecimal()
public boolean isFloat()
public boolean isDouble()
public boolean hasDateTime()
public boolean isDateTime()
public boolean isDate()
public boolean isLiteral()
public boolean isTime()
public boolean isDuration()
public boolean isYearMonth()
public boolean isGYear()
public boolean isGYearMonth()
public boolean isGMonth()
public boolean isGMonthDay()
public boolean isGDay()
public boolean getBoolean()
public String getString()
public BigInteger getInteger()
public BigDecimal getDecimal()
public float getFloat()
public double getDouble()
public XMLGregorianCalendar getDateTime()
public Duration getDuration()
public static void raise(ExprException ex)
public void visit(ExprVisitor visitor)
public final String asUnquotedString()
public final String asQuotedString()
public final String asQuotedString(SerializationContext context)
public String asString()
public abstract void visit(NodeValueVisitor visitor)
public Expr apply(ExprTransform transform)
Licenced under the Apache License, Version 2.0