net.sf.saxon.tree.iter

## Class UnparsedTextIterator

- java.lang.Object
- - net.sf.saxon.tree.iter.TextLinesIterator
  - - net.sf.saxon.tree.iter.UnparsedTextIterator

- All Implemented Interfaces:
    SequenceIterator<StringValue>

      public class UnparsedTextIterator
      extends TextLinesIterator

  Class UnparsedTextIterator, iterates over a file line by line

- - ### Field Summary

    - ### Fields inherited from class net.sf.saxon.tree.iter.TextLinesIterator

      `checker, location, reader, uri`

    - ### Fields inherited from interface net.sf.saxon.om.SequenceIterator

      `GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnparsedTextIterator(URI absoluteURI, XPathContext context, String encoding, SourceLocator location)` Create a UnparsedTextIterator over a given file

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SequenceIterator<StringValue>` | `getAnother()` Get another SequenceIterator that iterates over the same items as the original, but which is repositioned at the start of the sequence.

    - ### Methods inherited from class net.sf.saxon.tree.iter.TextLinesIterator

      `close, current, getProperties, next, position`

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

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

- - ### Constructor Detail

    - #### UnparsedTextIterator

          public UnparsedTextIterator(URI absoluteURI,
                              XPathContext context,
                              String encoding,
                              SourceLocator location)
                               throws XPathException

      Create a UnparsedTextIterator over a given file
      Parameters:
        `absoluteURI` - the URI identifying the file
        `context` - the dynamic evaluation context
        `encoding` - the expected encoding of the file
        `location` - the location of the instruction being executed
      Throws:
        `XPathException` - if a dynamic error occurs

  - ### Method Detail

    - #### getAnother

          public SequenceIterator<StringValue> getAnother()
                                                   throws XPathException

      Description copied from interface: `SequenceIterator`
      Get another SequenceIterator that iterates over the same items as the original, but which is repositioned at the start of the sequence.

      This method allows access to all the items in the sequence without disturbing the current position of the iterator. Internally, its main use is in evaluating the last() function.

      This method does not change the state of the iterator.

      Some implementations of this method may regenerate the input sequence, creating new nodes with different identity from the original. This is not recommended, but is hard to prevent. This causes no problem for the primary usage of this method to support the last() function, but it has been known to cause trouble in other situations.

      Returns:
        a SequenceIterator that iterates over the same items, positioned before the first item
      Throws:
        `XPathException` - if any error occurs

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