com.saxonica.deploy
Class CompiledMemoClosure
java.lang.Object
   net.sf.saxon.value.Value
net.sf.saxon.value.Value
       com.saxonica.deploy.CompiledClosure
com.saxonica.deploy.CompiledClosure
           com.saxonica.deploy.CompiledMemoClosure
com.saxonica.deploy.CompiledMemoClosure
- All Implemented Interfaces: 
- Serializable, SequenceIterable, ValueRepresentation
- public class CompiledMemoClosure 
- extends CompiledClosure
A CompiledMemoClosure is a closure that remembers the input values once they have been read the
 first time. It is similar in operation to the MemoClosure class used
 by the interpreter.
- See Also:
- Serialized Form
| Nested Class Summary | 
|  class | CompiledMemoClosure.ProgressiveIteratorA ProgressiveIterator starts by reading any items already held in the reservoir;
 when the reservoir is exhausted, it reads further items from the inputIterator,
 copying them into the reservoir as they are read.
 | 
 
| Field Summary | 
| protected static int | EMPTY
 | 
| protected  int | state
 | 
 
 
 
 
 
| Method Summary | 
|  int | getLength()Get the length of the sequence
 | 
|  Item | itemAt(int n)Get the n'th item in the sequence (starting from 0).
 | 
|  SequenceIterator | iterate()Evaluate the expression in a given context to return an iterator over a sequence
 | 
 
 
| Methods inherited from class net.sf.saxon.value.Value | 
| asItem, asItem, asIterator, asValue, checkPermittedContents, convertToJava, effectiveBooleanValue, equals, fromItem, getCanonicalLexicalRepresentation, getIterator, getStringValue, getStringValueCS, hashCode, isIdentical, iterate, process | 
 
 
state
protected int state
EMPTY
protected static final int EMPTY
- See Also:
- Constant Field Values
CompiledMemoClosure
public CompiledMemoClosure(SequenceIterator inputIterator,
                           int primitiveType,
                           int cardinality)
CompiledMemoClosure
public CompiledMemoClosure(CompiledClosure input)
iterate
public SequenceIterator iterate()
                         throws XPathException
- Evaluate the expression in a given context to return an iterator over a sequence
 
- 
- Overrides:
- iteratein class- CompiledClosure
 
- 
- Returns:
- an iterator over the sequence of items
- Throws:
- XPathException- if a dynamic error occurs. This is possible only in the case of values
 that are materialized lazily, that is, where the iterate() method leads to computation of an
 expression that delivers the values.
 
itemAt
public Item itemAt(int n)
            throws XPathException
- Description copied from class: Value
- Get the n'th item in the sequence (starting from 0). This is defined for all
 Values, but its real benefits come for a sequence Value stored extensionally
 (or for a MemoClosure, once all the values have been read)
 
- 
- Overrides:
- itemAtin class- Value
 
- 
- Parameters:
- n- position of the required item, counting from zero.
- Returns:
- the n'th item in the sequence, where the first item in the sequence is
 numbered zero. If n is negative or >= the length of the sequence, returns null.
- Throws:
- XPathException
 
getLength
public int getLength()
              throws XPathException
- Get the length of the sequence
 
- 
- Overrides:
- getLengthin class- CompiledClosure
 
- 
- Returns:
- the number of items in the sequence
- Throws:
- XPathException
 
Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.