Package net.sf.saxon.expr
Interface LastPositionFinder
-
- All Known Implementing Classes:
ARegexIterator
,ArrayIterator
,ArrayIterator.Of
,ArrayIterator.OfNodes
,AscendingRangeIterator
,BigRangeIterator
,DescendingRangeIterator
,EmptyIterator
,FocusTrackingIterator
,GroupAdjacentIterator
,GroupByIterator
,GroupByIterator.ManualGroupByIterator
,GroupEndingIterator
,GroupMatchingIterator
,GroupStartingIterator
,ItemCheckingIterator
,ItemMappingIterator
,JRegexIterator
,ListIterator
,ListIterator.Of
,ListIterator.OfAtomic
,ManualGroupIterator
,ManualIterator
,ManualRegexIterator
,MemoSequence.ProgressiveIterator
,MergeGroupingIterator
,MergeGroupingIterator.ManualMergeGroupingIterator
,MultiIndex.SelectedItemsIterator
,MultithreadedFocusTrackingIterator
,MultithreadedItemMappingIterator
,NodeListIterator
,OneToOneMappingIterator
,net.sf.saxon.expr.RangeIterator
,Remove.RemoveIterator
,Reverse.ReverseListIterator
,SingleAtomicIterator
,SingleNodeIterator
,SingletonIterator
,SortedGroupIterator
,SortedIterator
,SubsequenceIterator
,TailIterator
,TwoItemIterator
,UntypedAtomizingIterator
,ZenoSequence.ZenoSequenceIterator
public interface LastPositionFinder
A LastPositionFinder is an interface implemented by any SequenceIterator that is able to return the position of the last item in the sequence.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getLength()
Get the last position (that is, the number of items in the sequence).boolean
supportsGetLength()
Ask whether this iterator supports use of thegetLength()
method.
-
-
-
Method Detail
-
supportsGetLength
boolean supportsGetLength()
Ask whether this iterator supports use of thegetLength()
method. This method should always be called before callinggetLength()
, because an iterator that implements this interface may support use ofgetLength()
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 thesupportsGetLength()
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 itemsjava.lang.ClassCastException
- if the capability is not available. (This exception is not guaranteed.)
-
-