Overview | Package | Class | Tree | Deprecated | Index | Help
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

## Package net.sf.saxon.value

This package provides classes representing XPath values (that is, the results of an expression).

See:
Description

Class Summary
AnyURIValue | An XPath value of type xs:anyURI.
AtomicValue | A AtomicValue is a value that isn't a sequence and isn't a node.
Base64BinaryValue | A value of type xs:base64Binary
BigIntegerValue | An integer value: note this is a subtype of decimal in XML Schema, not a primitive type.
BooleanValue | A boolean XPath value
CalendarValue | 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 type DateTime
DateValue | A value of type Date.
DecimalValue | A decimal value
DoubleValue | A numeric (double precision floating point) value
DurationValue | A value of type xs:duration
EmptySequence | An EmptySequence object represents a sequence containing no members.
ErrorValue | An ErrorValue is a value that has failed validation.
FloatValue | A numeric (single precision floating point) value
GDayValue | Implementation of the xs:gDay data type
GMonthDayValue | Implementation of the xs:gYear data type
GMonthValue | Implementation of the xs:gMonth data type
GYearMonthValue | Implementation of the xs:gYearMonth data type
GYearValue | Implementation of the xs:gYear data type
HexBinaryValue | A value of type xs:hexBinary
IntegerValue | An integer value: note this is a subtype of decimal in XML Schema, not a primitive type.
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.
MonthDurationValue | A value of type xsd:yearMonthDuration
NotationValue | An xs:NOTATION value.
NumericValue | NumericValue is an abstract superclass for IntegerValue, DecimalValue, FloatValue, and DoubleValue
ObjectValue | An XPath value that encapsulates a Java object.
QNameValue | A QName value.
RestrictedStringValue | A value conforming to one of the built-in subtypes of String, specifically normalizedString, token, language, Name, NCName, ID, IDREF, ENTITY, NMTOKEN.
SecondsDurationValue | A value of type xsd:dayTimeDuration
SequenceExtent | A sequence value implemented extensionally.
SequenceIntent | A SequenceIntent is sequence value that uses deferred evaluation.
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.
SingletonNode | A value that is a sequence containing zero or one nodes
StringValue | An atomic value of type xs:string
TextFragmentValue | This class represents a temporary tree whose root document node owns a single text node.
TimeValue | A value of type xs:time
UntypedAtomicValue | An Untyped Atomic value.
Value | A value is the result of an expression but it is also an expression in its own right.
Whitespace | This class provides helper methods and constants for handling whitespace

## Package net.sf.saxon.value Description

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.

Michael H. Kay
Saxonica Limited
9 February 2005

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES