Package net.sf.saxon.expr.sort
Class GroupEndingIterator
- java.lang.Object
-
- net.sf.saxon.expr.sort.GroupMatchingIterator
-
- net.sf.saxon.expr.sort.GroupEndingIterator
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,LastPositionFinder
,GroupIterator
,SequenceIterator
,LookaheadIterator
public class GroupEndingIterator extends GroupMatchingIterator implements GroupIterator, LookaheadIterator
A GroupEndingIterator iterates over a sequence of groups defined by xsl:for-each-group group-ending-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
Constructors Constructor Description GroupEndingIterator(PullEvaluator select, Pattern endPattern, XPathContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
advance()
int
getLength()
Get the last position (that is, the number of items in the sequence).boolean
supportsGetLength()
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 Detail
-
GroupEndingIterator
public GroupEndingIterator(PullEvaluator select, Pattern endPattern, XPathContext context) throws XPathException
- Throws:
XPathException
-
-
Method Detail
-
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
protected void advance() throws XPathException
- Specified by:
advance
in classGroupMatchingIterator
- Throws:
XPathException
-
-