- All Known Implementing Classes:
public interface LastPositionFinderA LastPositionFinder is an interface implemented by any SequenceIterator that is able to return the position of the last item in the sequence.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
getLength()Get the last position (that is, the number of items in the sequence).
supportsGetLength()Ask whether this iterator supports use of the
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
- true if the
getLength()method can be called to determine the length of the underlying sequence.
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.
- the number of items in the sequence
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.)