Class NodeValue

    • Field Detail

      • VerboseWarnings

        public static boolean VerboseWarnings
      • VerboseExceptions

        public static boolean VerboseExceptions
      • nvZERO

        public static final NodeValue nvZERO
      • nvNegZERO

        public static final NodeValue nvNegZERO
      • nvDecimalZERO

        public static final NodeValue nvDecimalZERO
      • nvDecimalONE

        public static final NodeValue nvDecimalONE
      • nvNegINF

        public static final NodeValue nvNegINF
      • nvEmptyString

        public static final NodeValue nvEmptyString
      • xmlDatatypeFactory

        public static javax.xml.datatype.DatatypeFactory xmlDatatypeFactory
    • Method Detail

      • parse

        public static NodeValue parse​(java.lang.String string)
        Convenience operation - parse a string to produce a NodeValue - common namespaces like xsd: are built-in
      • makeInteger

        public static NodeValue makeInteger​(long i)
      • makeInteger

        public static NodeValue makeInteger​(java.math.BigInteger i)
      • makeInteger

        public static NodeValue makeInteger​(java.lang.String lexicalForm)
      • makeFloat

        public static NodeValue makeFloat​(float f)
      • makeDouble

        public static NodeValue makeDouble​(double d)
      • makeString

        public static NodeValue makeString​(java.lang.String s)
      • makeSortKey

        public static NodeValue makeSortKey​(java.lang.String s,
                                            java.lang.String collation)
      • makeLangString

        public static NodeValue makeLangString​(java.lang.String s,
                                               java.lang.String lang)
      • makeDecimal

        public static NodeValue makeDecimal​(java.math.BigDecimal d)
      • makeDecimal

        public static NodeValue makeDecimal​(long i)
      • makeDecimal

        public static NodeValue makeDecimal​(double d)
      • makeDecimal

        public static NodeValue makeDecimal​(java.lang.String lexicalForm)
      • makeDateTime

        public static NodeValue makeDateTime​(java.lang.String lexicalForm)
      • makeDate

        public static NodeValue makeDate​(java.lang.String lexicalForm)
      • makeDateTime

        public static NodeValue makeDateTime​(java.util.Calendar cal)
      • makeDateTime

        public static NodeValue makeDateTime​(javax.xml.datatype.XMLGregorianCalendar cal)
      • makeDate

        public static NodeValue makeDate​(java.util.Calendar cal)
      • makeDate

        public static NodeValue makeDate​(javax.xml.datatype.XMLGregorianCalendar cal)
      • makeDuration

        public static NodeValue makeDuration​(java.lang.String lexicalForm)
      • makeDuration

        public static NodeValue makeDuration​(javax.xml.datatype.Duration duration)
      • makeNodeDuration

        public static NodeValue makeNodeDuration​(javax.xml.datatype.Duration duration,
                                                 Node node)
      • makeBoolean

        public static NodeValue makeBoolean​(boolean b)
      • booleanReturn

        public static NodeValue booleanReturn​(boolean b)
      • makeNode

        public static NodeValue makeNode​(java.lang.String lexicalForm,
                                         java.lang.String langTag,
                                         Node datatype)
      • makeNode

        public static NodeValue makeNode​(java.lang.String lexicalForm,
                                         java.lang.String langTag,
                                         java.lang.String datatype)
      • makeNodeBoolean

        public static NodeValue makeNodeBoolean​(boolean b)
      • makeNodeBoolean

        public static NodeValue makeNodeBoolean​(java.lang.String lexicalForm)
      • makeNodeInteger

        public static NodeValue makeNodeInteger​(long v)
      • makeNodeInteger

        public static NodeValue makeNodeInteger​(java.lang.String lexicalForm)
      • makeNodeFloat

        public static NodeValue makeNodeFloat​(float f)
      • makeNodeFloat

        public static NodeValue makeNodeFloat​(java.lang.String lexicalForm)
      • makeNodeDouble

        public static NodeValue makeNodeDouble​(double v)
      • makeNodeDouble

        public static NodeValue makeNodeDouble​(java.lang.String lexicalForm)
      • makeNodeDecimal

        public static NodeValue makeNodeDecimal​(java.math.BigDecimal decimal)
      • makeNodeDecimal

        public static NodeValue makeNodeDecimal​(java.lang.String lexicalForm)
      • makeNodeString

        public static NodeValue makeNodeString​(java.lang.String string)
      • makeNodeDateTime

        public static NodeValue makeNodeDateTime​(java.util.Calendar date)
      • makeNodeDateTime

        public static NodeValue makeNodeDateTime​(java.lang.String lexicalForm)
      • makeNodeDate

        public static NodeValue makeNodeDate​(java.util.Calendar date)
      • makeNodeDate

        public static NodeValue makeNodeDate​(java.lang.String lexicalForm)
      • isConstant

        public boolean isConstant()
        Description copied from interface: Expr
        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
        Specified by:
        isConstant in interface Expr
        isConstant in class ExprNode
      • isIRI

        public boolean isIRI()
      • isBlank

        public boolean isBlank()
      • isTripleTerm

        public boolean isTripleTerm()
      • sameAs

        public 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
      • notSameAs

        public 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
      • notSameAs

        public 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
      • compareAlways

        public 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
        nv1 -
        nv2 -
        negative, 0, or positive for less than, equal, greater than.
      • compare

        public static int compare​(NodeValue nv1,
                                  NodeValue nv2)
        Compare by value (and only value) if possible. Supports <, <=, >, >= but not = nor != (which are sameValueAs and notSameValueAs)
        nv1 -
        nv2 -
        Expr.CMP_INDETERMINATE(+2), Expr.CMP_LESS(-1), Expr.CMP_EQUAL(0) or Expr.CMP_GREATER(+1)
      • asNode

        public final Node asNode()
      • getNode

        public Node getNode()
        getNode - return the node form - may be null (use .asNode() to force to a node)
      • getDatatypeURI

        public java.lang.String getDatatypeURI()
      • hasNode

        public boolean hasNode()
      • isBoolean

        public boolean isBoolean()
      • isString

        public boolean isString()
      • isLangString

        public boolean isLangString()
      • isSortKey

        public boolean isSortKey()
      • isNumber

        public boolean isNumber()
      • isInteger

        public boolean isInteger()
      • isDecimal

        public boolean isDecimal()
      • isFloat

        public boolean isFloat()
      • isDouble

        public boolean isDouble()
      • hasDateTime

        public boolean hasDateTime()
      • isDateTime

        public boolean isDateTime()
      • isDate

        public boolean isDate()
      • isLiteral

        public boolean isLiteral()
      • isTime

        public boolean isTime()
      • isDuration

        public boolean isDuration()
      • isYearMonthDuration

        public boolean isYearMonthDuration()
      • isDayTimeDuration

        public boolean isDayTimeDuration()
      • isGYear

        public boolean isGYear()
      • isGYearMonth

        public boolean isGYearMonth()
      • isGMonth

        public boolean isGMonth()
      • isGMonthDay

        public boolean isGMonthDay()
      • isGDay

        public boolean isGDay()
      • getBoolean

        public boolean getBoolean()
      • getString

        public java.lang.String getString()
      • getLang

        public java.lang.String getLang()
      • getInteger

        public java.math.BigInteger getInteger()
      • getDecimal

        public java.math.BigDecimal getDecimal()
      • getFloat

        public float getFloat()
      • getDouble

        public double getDouble()
      • getDateTime

        public javax.xml.datatype.XMLGregorianCalendar getDateTime()
      • getDuration

        public javax.xml.datatype.Duration getDuration()
      • asUnquotedString

        public final java.lang.String asUnquotedString()
      • asQuotedString

        public final java.lang.String asQuotedString()
      • asString

        public java.lang.String asString()
      • hashCode

        public int hashCode()
        Description copied from interface: Expr
        Expr are used in both syntax and algebra. There is no syntax to algebra translation step because the parser uses operator precedence to build the right evaluation structure directly.

        The exceptions to this are the NOT EXISTS and EXISTS expressions which involve a query pattern. As a result there are different ways in syntax to produce the same algebra form.

        Two Expr are considered equal if they are equal as algebra expressions. hashCode and equals must implement that.

        There is also equalsBySyntax. Because two different syntax forms can yield the same algebra, but two different algebra forms must be different syntax, equalsBySyntax implies equals (by alegbra).

        Hence, different hashCode => not equalsBySyntax.

        Specified by:
        hashCode in interface Expr
        Specified by:
        hashCode in class ExprNode
      • equals

        public boolean equals​(Expr other,
                              boolean bySyntax)
        Description copied from interface: Expr
        General equality operation - consider this to be 'protected'
        Specified by:
        equals in interface Expr
        Specified by:
        equals in class ExprNode
      • toString

        public java.lang.String toString()
        toString in class ExprNode