Project

Profile

Help

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

he / latest10 / hej / net / sf / saxon / value / package.html @ c10300c0

1
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
2
<!-- Copyright (c) 2014 Saxonica Limited. -->
3
<!-- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. -->
4
<!-- If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5
<!-- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -->
6
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
7

    
8
<html>
9

    
10
<head>
11
    <title>Package overview for net.sf.saxon.value</title>
12
</head>
13

    
14
<body>
15

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

    
19
<p>The principal class is:</p>
20

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

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

    
34
<p>In general a value is a sequence. A sequence that is instantiated in memory is represented by a
35
    <code>SequenceExtent</code> object. The code tries to pipeline execution so that a <code>SequenceExtent</code>
36
    is created as rarely as possible.</p>
37

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

    
49

    
50
</body>
51
</html>
(50-50/50)