net.sf.saxon.om

## Class MemoSequence

- java.lang.Object
- - net.sf.saxon.om.MemoSequence

- All Implemented Interfaces:
    Sequence

      public class MemoSequence
      extends Object
      implements Sequence

  A Sequence implementation that represents a lazy evaluation of a supplied iterator

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `MemoSequence.ProgressiveIterator` A 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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static int` | `EMPTY`
    `protected int` | `state`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MemoSequence(SequenceIterator iterator)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Item` | `head()` Get the first item in the sequence.
    `SequenceIterator` | `iterate()` Get an iterator performance characteristics, though all should exhibit the same behaviour.over all the items in the sequence

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### state

          protected int state

    - #### EMPTY

          protected static final int EMPTY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MemoSequence

          public MemoSequence(SequenceIterator iterator)

  - ### Method Detail

    - #### head

          public Item head()
                    throws XPathException

      Description copied from interface: `Sequence`
      Get the first item in the sequence.
      Specified by:
        `head` in interface `Sequence`
      Returns:
        the first item in the sequence if there is one, or null if the sequence is empty
      Throws:
        `XPathException` - in the situation where the sequence is evaluated lazily, and evaluation of the first item causes a dynamic error.

    - #### iterate

          public SequenceIterator iterate()
                                   throws XPathException

      Description copied from interface: `Sequence`
      Get an iterator performance characteristics, though all should exhibit the same behaviour.over all the items in the sequence
      Specified by:
        `iterate` in interface `Sequence`
      Returns:
        an iterator over all the items
      Throws:
        `XPathException` - in the situation where the sequence is evaluated lazily, and constructing an iterator over the items causes a dynamic error.

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.