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 voidadvance()intGet the last position (that is, the number of items in the sequence).booleanAsk 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, supportsHasNextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.expr.sort.GroupIterator
currentGroup, getCurrentGroupingKey, getSnapShotMethods inherited from interface net.sf.saxon.tree.iter.LookaheadIterator
hasNext, supportsHasNextMethods 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:LastPositionFinderAsk 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:
supportsGetLengthin 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:LastPositionFinderGet 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:
getLengthin interfaceLastPositionFinder- Returns:
- the number of items in the sequence
-
advance
- Specified by:
advancein classGroupMatchingIterator- Throws:
XPathException
-