## net.sf.saxon.value
Class SequenceIntent

    java.lang.Object
      net.sf.saxon.value.Value
          net.sf.saxon.value.SequenceIntent

All Implemented Interfaces:
  Expression, java.io.Serializable, ValueRepresentation

public class SequenceIntent
extends Value

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

Field Summary

Fields inherited from interface net.sf.saxon.expr.Expression
`EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD`

Constructor Summary
`SequenceIntent(SequenceIterator iterator)` Construct a SequenceIntent by supplying an iterator.

Method Summary
`int` `getImplementationMethod()` An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
`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.Value

`analyze, asItem, asValue, checkPermittedContents, collapseWhitespace, convert, convertJavaObjectToXPath, convertToJava, display, effectiveBooleanValue, equals, evaluateAsString, evaluateItem, getCardinality, getDependencies, getIterator, getLength, getParentExpression, getSpecialProperties, getStringValue, hashCode, iterateSubExpressions, makeQNameValue, normalizeWhitespace, process, promote, simplify, stringToNumber, toString, trimWhitespace`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, 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

### getImplementationMethod

    public int getImplementationMethod()

  An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). This method indicates which of these methods is prefered.

### getItemType

    public ItemType getItemType()

  Get the item type

  Specified by:
    `getItemType` in interface `Expression`
  Overrides:
    `getItemType` in class `Value`
  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 `Value`
  Throws:
    `XPathException`