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
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. It is also used when streaming with xsl:fork, which involves pseudo-parallel processing of groups.
-
-
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)
GroundedValue
currentGroup()
Get a sequence containing the members of the current group, in population order.boolean
currentGroupContains(NodeInfo node)
AtomicSequence
getCurrentGroupingKey()
Get the grouping key of the current groupManualGroupIterator
getSnapShot(XPathContext context)
Get a pseudo-iterator which represents a snapshot of this sequence at the current positionvoid
setCurrentGroup(GroundedValue 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, 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 pseudo-iterator which represents 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(GroundedValue group)
-
appendToCurrentGroup
public void appendToCurrentGroup(Item item)
-
startNewCurrentGroup
public void startNewCurrentGroup(Item item)
-
currentGroup
public GroundedValue currentGroup() throws XPathException
Description copied from interface:GroupIterator
Get a sequence containing the members of the current group, in population order. This may be a MemoSequence rather than a grounded value- Specified by:
currentGroup
in interfaceGroupIterator
- Returns:
- a sequence containing all the members of the current group, in population order.
- Throws:
XPathException
- if a dynamic error occurs
-
currentGroupContains
public boolean currentGroupContains(NodeInfo node) throws XPathException
- Throws:
XPathException
-
-