Package com.saxonica.ee.stream
Class ManualGroupIterator
- java.lang.Object
-
- net.sf.saxon.tree.iter.ManualIterator
-
- com.saxonica.ee.stream.ManualGroupIterator
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,LastPositionFinder
,GroupIterator
,FocusIterator
,SequenceIterator
,GroundedIterator
,LookaheadIterator
,ReversibleIterator
- Direct Known Subclasses:
GroupByIterator.ManualGroupByIterator
,MergeGroupingIterator.ManualMergeGroupingIterator
public class ManualGroupIterator extends ManualIterator implements GroupIterator
The class ManualGroupIterator represents an iterator that is never repositioned, but can be used to represent the focus in the dynamic context. It is used as a snapshot copy of a real grouping iterator for use when asynchronous threads are forked, as in xsl:result-document; the purpose of taking a snapshot is to ensure that changes to the base iterator in one thread do not affect the focus of another thread.
-
-
Constructor Summary
Constructors Constructor Description ManualGroupIterator(Item item, int position)
Create a manual grouping iterator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendToCurrentGroup(Item item)
boolean
currentGroupContains(Item item)
AtomicSequence
getCurrentGroupingKey()
Get the grouping key of the current groupManualGroupIterator
getSnapShot(XPathContext context)
Get a sequence which is a snapshot of this sequence at the current positionSequenceIterator
iterateCurrentGroup()
Get an iterator over the members of the current group, in population order.void
setCurrentGroup(java.util.List<Item> group)
void
setCurrentGroupingKey(AtomicSequence key)
void
startNewCurrentGroup(Item item)
-
Methods inherited from class net.sf.saxon.tree.iter.ManualIterator
current, getLength, getResidue, getReverseIterator, hasNext, incrementPosition, isActuallyGrounded, materialize, next, position, setContextItem, setLengthFinder, setPosition, supportsGetLength, 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.om.SequenceIterator
close, discharge, next
-
-
-
-
Constructor Detail
-
ManualGroupIterator
public ManualGroupIterator(Item item, int position)
Create a manual grouping iterator- Parameters:
item
- the context itemposition
- the context position
-
-
Method Detail
-
getSnapShot
public ManualGroupIterator getSnapShot(XPathContext context)
Description copied from interface:GroupIterator
Get a sequence which is a snapshot of this sequence at the current position- Specified by:
getSnapShot
in interfaceGroupIterator
- Parameters:
context
- the XPath context- Returns:
- the snapshot sequence
-
setCurrentGroupingKey
public void setCurrentGroupingKey(AtomicSequence key)
-
getCurrentGroupingKey
public AtomicSequence getCurrentGroupingKey()
Description copied from interface:GroupIterator
Get the grouping key of the current group- Specified by:
getCurrentGroupingKey
in interfaceGroupIterator
- Returns:
- the current grouping key in the case of group-by or group-adjacent, or null in the case of group-starting-with and group-ending-with
-
setCurrentGroup
public void setCurrentGroup(java.util.List<Item> group)
-
appendToCurrentGroup
public void appendToCurrentGroup(Item item)
-
startNewCurrentGroup
public void startNewCurrentGroup(Item item)
-
iterateCurrentGroup
public SequenceIterator iterateCurrentGroup() throws XPathException
Description copied from interface:GroupIterator
Get an iterator over the members of the current group, in population order. This must always be a clean iterator, that is, an iterator that starts at the first item of the group.- Specified by:
iterateCurrentGroup
in interfaceGroupIterator
- Returns:
- an iterator over all the members of the current group, in population order.
- Throws:
XPathException
- if a dynamic error occurs
-
currentGroupContains
public boolean currentGroupContains(Item item)
-
-