Class ManualGroupIterator

java.lang.Object
net.sf.saxon.tree.iter.ManualIterator
com.saxonica.ee.stream.ManualGroupIterator
All Implemented Interfaces:
Closeable, 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 Details

    • ManualGroupIterator

      public ManualGroupIterator(Item item, int position)
      Create a manual grouping iterator
      Parameters:
      item - the context item
      position - the context position
  • Method Details

    • 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 interface GroupIterator
      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 interface GroupIterator
      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 interface GroupIterator
      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