Interface LastPositionFinder

    • Method Detail

      • supportsGetLength

        boolean supportsGetLength()
        Ask whether this iterator supports use of the getLength() method. This method should always be called before calling getLength(), because an iterator that implements this interface may support use of getLength() in some situations and not in others
        Returns:
        true if the getLength() method can be called to determine the length of the underlying sequence.
      • getLength

        int getLength()
        Get the last position (that is, the number of items in the sequence). This method is non-destructive: it does not change the state of the iterator. The result is undefined if the next() method of the iterator has already returned null. This method must not be called unless the supportsGetLength() has been called and has returned true.
        Returns:
        the number of items in the sequence
        Throws:
        UncheckedXPathException - if an error occurs evaluating the sequence in order to determine the number of items
        java.lang.ClassCastException - if the capability is not available. (This exception is not guaranteed.)