Class SortedTupleIterator

  extended by net.sf.saxon.expr.sort.SortedIterator
      extended by net.sf.saxon.expr.sort.SortedTupleIterator
All Implemented Interfaces:
LastPositionFinder, Sortable, SequenceIterator, LookaheadIterator

public class SortedTupleIterator
extends SortedIterator

A SortedTupleIterator is a modified SortedIterator. Whereas the sorted iterator used by XSLT computes the sort key of each item in a sequence, using that item as the context item, the SortedTupleIterator used by XQuery precomputes the sort keys from scratch; they do not need to be a function of the item being sorted.

The items returned by the SortedTupleIterator are instance of ObjectValue, which encapsulate a Value representing the contents of the tuple.

Field Summary
Fields inherited from class net.sf.saxon.expr.sort.SortedIterator
base, comparators, context, count, nodeKeys, position, recordSize, sortKeyEvaluator
Fields inherited from interface
Constructor Summary
SortedTupleIterator(XPathContext context, SequenceIterator base, AtomicComparer[] comparators)
          Create a sorted tuple iterator
Method Summary
protected  void buildArray()
          Override the method that builds the array of values and sort keys.
Methods inherited from class net.sf.saxon.expr.sort.SortedIterator
close, compare, current, getAnother, getLastPosition, getProperties, hasNext, next, position, setHostLanguage, swap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SortedTupleIterator(XPathContext context,
                           SequenceIterator base,
                           AtomicComparer[] comparators)
Create a sorted tuple iterator

context - the dynamic context
base - the base iterator, which returns the unsorted tuples. Each tuple is represented by an ObjectValue which wraps an array of Value objects. The first Value object represents the tuple itself. Subsequent Value objects represent the sort key values, in order.
comparators - the comparators used for comparing sort keys
Method Detail


protected void buildArray()
                   throws XPathException
Override the method that builds the array of values and sort keys.

buildArray in class SortedIterator

Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.