Package net.sf.saxon.value
This package provides classes representing XPath values (that is, the results of an expression). There are different classes for different types of value.
The principal class is:
Value:
This represents the result of evaluating an expression. But a Value is also an expression in its
own right, reflecting the fact that literal values can be used syntactically wherever expressions
can be used. AtomicValue
is a subclass of Value
that represents an atomic value: this in turn has subclasses for the different built-in data types:
StringValue, NumericValue, BooleanValue, DateValue, and so on.
There are two classes used to represent integer values: IntegerValue
for integers that
fit comfortably in 64 bits, and BigIntegerValue
for anything longer. Built-in subtypes
of xs:integer, such as xs:int
and xs:short
, are always represented using
an IntegerValue
, except for xs:unsignedLong
, which uses a BigIntegerValue
.
In general a value is a sequence. A sequence that is instantiated in memory is represented by a
SequenceExtent
object. The code tries to pipeline execution so that a SequenceExtent
is created as rarely as possible.
When an expression is evaluated lazily, the result is a Closure
. A Closure contains the original
expression, and a copy of the run-time context at the time evaluation was requested: that is, all the local
variables
and other information that it depends on, such as the context item. There are two kinds of Closure, and the system
decides at compile time which to use. An ordinary Closure re-evaluates the expression every time the value is
referenced;
this is used only when the compiler decides that the value is likely to be referenced only once. A MemoClosure
remembers
the value the first time it is needed, so that subsequent references do not cause repeated evaluation of the
expression.
-
Interface Summary Interface Description AnyExternalObject An external object is a fourth kind of Item (after nodes, atomic values, and functions): it acts as a wrapper for a Java object (or, in C#, a .NET object).ContextFreeAtomicValue This interface is implemented by AtomicValues that can be compared without regard to context - specifically, the result ofeq
andlt
comparisons does not depend on collations or on the context-dependent timezone. -
Class Summary Class Description AnyURIValue An XPath value of type xs:anyURI.AtomicValue The AtomicValue class corresponds to the concept of an atomic value in the XPath 2.0 data model.Base64BinaryValue A value of type xs:base64BinaryBigDecimalValue An implementation class for decimal values other than integersBigIntegerValue An integer value: note this is a subtype of decimal in XML Schema, not a primitive type.BooleanValue A boolean XPath valueCalendarValue Abstract superclass for Date, Time, and DateTime.Cardinality This class contains static methods to manipulate the cardinality property of a type.Closure A Closure represents a value that has not yet been evaluated: the value is represented by an expression, together with saved values of all the context variables that the expression depends on.DateTimeValue A value of typexs:dateTime
.DateTimeValue.DateTimeComparable DateTimeComparable is an object that implements the XML Schema rules for comparing date/time valuesDateValue A value of type Date.DayTimeDurationValue A value of type xs:dayTimeDuration.DecimalValue Abstract class representing the XDM type xs:decimal.DoubleValue A numeric (double precision floating point) valueDurationValue A value of type xs:durationDurationValue.DurationComparable DurationValueComparable is a Comparable value that acts as a surrogate for a Duration, having ordering rules that implement the XML Schema specification.EmptySequence An EmptySequence object represents a sequence containing no members.FloatingPointConverter This is a utility class that handles formatting of numbers as strings.FloatValue A numeric (single precision floating point) valueGDateValue Abstract superclass for the primitive types containing date components: xs:date, xs:gYear, xs:gYearMonth, xs:gMonth, xs:gMonthDay, xs:gDayGDateValue.GDateComparable GDayValue Implementation of the xs:gDay data typeGMonthDayValue Implementation of the xs:gYear data typeGMonthValue Implementation of the xs:gMonth data typeGYearMonthValue Implementation of the xs:gYearMonth data typeGYearValue Implementation of the xs:gYear data typeHexBinaryValue A value of type xs:hexBinaryInt64Value An integer value: note this is a subtype of decimal in XML Schema, not a primitive type.IntegerRange This class represents a sequence of integers, for example 1 by 5 to 50.IntegerValue This class represents the XPath built-in type xs:integer.MemoClosure A MemoClosure represents a value that has not yet been evaluated: the value is represented by an expression, together with saved values of all the context variables that the expression depends on.NestedIntegerValue This class represents a dot-separated sequence of numbers such as 1.12.5, typically used as a software version number.NotationValue An xs:NOTATION value.NumericValue NumericValue is an abstract superclass for IntegerValue, DecimalValue, FloatValue, and DoubleValueObjectValue<T> An XPath value that encapsulates a Java object.QNameValue A QName value.QualifiedNameValue A qualified name: this is an abstract superclass for QNameValue and NotationValue, representing the XPath primitive types xs:QName and xs:NOTATION respectivelySaxonDuration Saxon implementation of the JAXP class javax.xml.datatype.Duration.SaxonXMLGregorianCalendar Saxon implementation of the JAXP class javax.xml.datatype.XMLGregorianCalendar.SequenceExtent A sequence value implemented extensionally.SequenceExtent.Of<T extends Item> SequenceType SequenceType: a sequence type consists of a primary type, which indicates the type of item, and a cardinality, which indicates the number of occurrences permitted.SingletonClosure A SingletonClosure represents a value that has not yet been evaluated: the value is represented by an expression, together with saved values of all the context variables that the expression depends on.StringToDouble11 Convert a string to a double using the rules of XML Schema 1.1StringValue An atomic value of type xs:string.StringValue.Builder StringValue.CharacterIterator CharacterIterator is used to iterate over the characters in a string, returning them as integers representing the Unicode code-point.TextFragmentValue This class represents a temporary tree whose root document node owns a single text node.TimeValue A value of type xs:timeTimeValue.TimeComparable Whitespace This class provides helper methods and constants for handling whitespaceWhitespace.Tokenizer An iterator that splits a string on whitespace boundaries, corresponding to the XPath 3.1 function tokenize#1YearMonthDurationValue A value of type xs:yearMonthDuration.