Project

Profile

Help

How to connect?
Download (2.23 KB) Statistics
| Branch: | Tag: | Revision:

he / tags / 9.2.0.5 / hej / net / sf / saxon / value / package.html @ 90ee0d1a

1
<html>
2

    
3
<head>
4
<title>Package overview for net.sf.saxon.value</title>
5
</head>
6

    
7
<body>
8

    
9
<p>This package provides classes representing XPath values (that is, the results of
10
an expression). There are different classes for different types of value.</p>
11

    
12
<p>The principal class is:</p>
13

    
14
<p><b>Value</b>: <br>
15
This represents the result of evaluating an expression. But a Value is also an expression in its
16
own right, reflecting the fact that literal values can be used syntactically wherever expressions
17
can be used. <code>AtomicValue</code> is a subclass of <code>Value</code>
18
that represents an atomic value: this in turn has subclasses for the different built-in data types:
19
StringValue, NumericValue, BooleanValue, DateValue, and so on.</p>
20

    
21
<p>There are two classes used to represent integer values: <code>IntegerValue</code> for integers that
22
fit comfortably in 64 bits, and <code>BigIntegerValue</code> for anything longer. Built-in subtypes
23
of xs:integer, such as <code>xs:int</code> and <code>xs:short</code>, are always represented using
24
an <code>IntegerValue</code>, except for <code>xs:unsignedLong</code>, which uses a <code>BigIntegerValue</code>.</p>
25

    
26
<p>In general a value is a sequence. A sequence that is instantiated in memory is represented by a
27
<code>SequenceExtent</code> object. The code tries to pipeline execution so that a <code>SequenceExtent</code>
28
is created as rarely as possible.</p>
29

    
30
<p>When an expression is evaluated lazily, the result is a <code>Closure</code>. A Closure contains the original
31
expression, and a copy of the run-time context at the time evaluation was requested: that is, all the local variables
32
and other information that it depends on, such as the context item. There are two kinds of Closure, and the system
33
decides at compile time which to use. An ordinary Closure re-evaluates the expression every time the value is referenced;
34
this is used only when the compiler decides that the value is likely to be referenced only once. A MemoClosure remembers
35
the value the first time it is needed, so that subsequent references do not cause repeated evaluation of the
36
expression.</p>
37

    
38
<hr>
39

    
40
<p align="center"><i>Michael H. Kay<br/>
41
Saxonica Limited<br/>
42
9 February 2005</i></p>
43
</body>
44
</html>
(46-46/46)