net.sf.saxon.value
Class SequenceIntent

java.lang.Object
  extended by net.sf.saxon.value.Value
      extended by net.sf.saxon.value.SequenceValue
          extended by net.sf.saxon.value.SequenceIntent
All Implemented Interfaces:
Serializable, Expression

public class SequenceIntent
extends SequenceValue

A SequenceIntent is sequence value that uses deferred evaluation. It can be used as a value, but it is actually a wrapper around an iterator and a context, so the items in the sequence are not evaluated until they are required.

See Also:
Serialized Form

Constructor Summary
SequenceIntent(SequenceIterator iterator)
          Construct a SequenceIntent by supplying an iterator.
 
Method Summary
 ItemType getItemType()
          Get the item type
 Item itemAt(int n)
          Get the n'th item in the sequence (starting from 0).
 SequenceIterator iterate(XPathContext context)
          Evaluate the expression in a given context to return a sequence
 
Methods inherited from class net.sf.saxon.value.SequenceValue
conversionPreference, convertToJava, display, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, nodeToJavaPreference
 
Methods inherited from class net.sf.saxon.value.Value
analyze, asItem, asValue, collapseWhitespace, getDependencies, getSpecialProperties, getSubExpressions, inverse, normalizeWhitespace, promote, simplify, stringToInteger, stringToNumber, trimWhitespace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceIntent

public SequenceIntent(SequenceIterator iterator)
Construct a SequenceIntent by supplying an iterator. Note that the caller must ensure this is a "clean" iterator: it must be positioned at the start, and must not be shared by anyone else. It is also required (at present) that the iterator should return items in the correct sequence.

Parameters:
iterator - the iterator that delivers the items in the sequence. It must deliver them in the correct order, with no duplicates.
Method Detail

getItemType

public ItemType getItemType()
Get the item type

Specified by:
getItemType in interface Expression
Overrides:
getItemType in class SequenceValue
Returns:
AnyItemType (not known)

iterate

public SequenceIterator iterate(XPathContext context)
                         throws XPathException
Evaluate the expression in a given context to return a sequence

Parameters:
context - the evaluation context.
Returns:
a SequenceIterator that can be used to iterate over the result of the expression
Throws:
XPathException - if any dynamic error occurs evaluating the expression

itemAt

public Item itemAt(int n)
            throws XPathException
Get the n'th item in the sequence (starting from 0). This is defined for all SequenceValues, but its real benefits come for a SequenceValue stored extensionally

Overrides:
itemAt in class SequenceValue
Throws:
XPathException