net.sf.saxon.sort
public class SortedIterator extends Object implements SequenceIterator, LastPositionFinder, LookaheadIterator, Sortable
Field Summary | |
---|---|
protected SequenceIterator | base |
protected AtomicComparer[] | comparators |
protected XPathContext | context |
protected int | count |
protected Object[] | nodeKeys |
protected int | position |
protected int | recordSize |
protected SortKeyEvaluator | sortKeyEvaluator |
Constructor Summary | |
---|---|
SortedIterator(XPathContext context, SequenceIterator base, SortKeyEvaluator sortKeyEvaluator, AtomicComparer[] comparators)
Create a sorted iterator |
Method Summary | |
---|---|
protected void | buildArray()
Create an array holding the items to be sorted and the values of their sort keys |
void | close() |
int | compare(int a, int b)
Compare two items in sorted sequence
(needed to implement the Sortable interface) |
Item | current() |
SequenceIterator | getAnother() |
int | getLastPosition() |
int | getProperties()
Get properties of this iterator, as a bit-significant integer.
|
boolean | hasNext()
Determine whether there are more items to come. |
Item | next()
Get the next item, in sorted order |
int | position() |
void | setHostLanguage(int language)
Set the host language |
void | swap(int a, int b)
Swap two items (needed to implement the Sortable interface) |
Parameters: context the dynamic XPath evaluation context base an iterator over the sequence to be sorted sortKeyEvaluator an object that allows the n'th sort key for a given item to be evaluated comparators an array of AtomicComparers, one for each sort key, for comparing sort key values
Throws: XPathException
Returns: <0 if obj[a]
Returns: the properties of this iterator. This will be some combination of properties such as SortedIterator, SortedIterator, and SortedIterator. 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.
Returns: true if there are more items in the sequence
Parameters: language the host language (for example XQUERY)