Package net.sf.saxon.expr.sort
Class GroupStartingIterator
java.lang.Object
net.sf.saxon.expr.sort.GroupMatchingIterator
net.sf.saxon.expr.sort.GroupStartingIterator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,LastPositionFinder
,GroupIterator
,SequenceIterator
,LookaheadIterator
public class GroupStartingIterator
extends GroupMatchingIterator
implements LookaheadIterator, GroupIterator
A GroupStartingIterator iterates over a sequence of groups defined by
xsl:for-each-group group-starting-with="x". The groups are returned in
order of first appearance.
-
Field Summary
Fields inherited from class net.sf.saxon.expr.sort.GroupMatchingIterator
baseContext, current, currentMembers, nextItem, pattern, population, position, runningContext, select
-
Constructor Summary
ConstructorsConstructorDescriptionGroupStartingIterator
(PullEvaluator select, Pattern startPattern, XPathContext context) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
advance()
int
Get the last position (that is, the number of items in the sequence).boolean
Ask whether this iterator supports use of theLastPositionFinder.getLength()
method.Methods inherited from class net.sf.saxon.expr.sort.GroupMatchingIterator
close, currentGroup, getCurrentGroupingKey, getSnapShot, hasNext, next, supportsHasNext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.saxon.expr.sort.GroupIterator
currentGroup, getCurrentGroupingKey, getSnapShot
Methods inherited from interface net.sf.saxon.tree.iter.LookaheadIterator
hasNext, supportsHasNext
Methods inherited from interface net.sf.saxon.om.SequenceIterator
close, next
-
Constructor Details
-
GroupStartingIterator
public GroupStartingIterator(PullEvaluator select, Pattern startPattern, XPathContext context) throws XPathException - Throws:
XPathException
-
-
Method Details
-
supportsGetLength
public boolean supportsGetLength()Description copied from interface:LastPositionFinder
Ask whether this iterator supports use of theLastPositionFinder.getLength()
method. This method should always be called before callingLastPositionFinder.getLength()
, because an iterator that implements this interface may support use ofLastPositionFinder.getLength()
in some situations and not in others- Specified by:
supportsGetLength
in interfaceLastPositionFinder
- Returns:
- true if the
LastPositionFinder.getLength()
method can be called to determine the length of the underlying sequence.
-
getLength
public int getLength()Description copied from interface:LastPositionFinder
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 theLastPositionFinder.supportsGetLength()
has been called and has returned true.- Specified by:
getLength
in interfaceLastPositionFinder
- Returns:
- the number of items in the sequence
-
advance
- Specified by:
advance
in classGroupMatchingIterator
- Throws:
XPathException
-