net.sf.saxon.sort

Class GroupEndingIterator

Implemented Interfaces:
GroupIterator, LookaheadIterator, SequenceIterator

public class GroupEndingIterator
extends java.lang.Object
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.

Fields inherited from interface net.sf.saxon.om.SequenceIterator

GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD

Constructor Summary

GroupEndingIterator(SequenceIterator population, Pattern endPattern, XPathContext context)

Method Summary

Item
current()
SequenceIterator
getAnother()
AtomicValue
getCurrentGroupingKey()
int
getProperties()
Get properties of this iterator, as a bit-significant integer.
boolean
hasNext()
Determine whether there are more items to come.
SequenceIterator
iterateCurrentGroup()
Item
next()
int
position()

Constructor Details

GroupEndingIterator

public GroupEndingIterator(SequenceIterator population,
                           Pattern endPattern,
                           XPathContext context)
            throws XPathException

Method Details

current

public Item current()
Specified by:
current in interface SequenceIterator

getAnother

public SequenceIterator getAnother()
            throws XPathException
Specified by:
getAnother in interface SequenceIterator

getCurrentGroupingKey

public AtomicValue getCurrentGroupingKey()
Specified by:
getCurrentGroupingKey in interface GroupIterator

getProperties

public int getProperties()
Get properties of this iterator, as a bit-significant integer.
Specified by:
getProperties in interface SequenceIterator
Returns:
the properties of this iterator. This will be some combination of properties such as SequenceIterator.GROUNDED, SequenceIterator.LAST_POSITION_FINDER, and SequenceIterator.LOOKAHEAD. It is always acceptable to return the value zero, indicating that there are no known special properties. It is acceptable for the properties of the iterator to change depending on its state.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface LookaheadIterator
Returns:
true if there are more items in the sequence

iterateCurrentGroup

public SequenceIterator iterateCurrentGroup()
Specified by:
iterateCurrentGroup in interface GroupIterator

next

public Item next()
            throws XPathException
Specified by:
next in interface SequenceIterator

position

public int position()
Specified by:
position in interface SequenceIterator