net.sf.saxon.sort

Class DocumentOrderIterator

public final class DocumentOrderIterator extends Object implements SequenceIterator, Sortable

DocumentOrderIterator takes as input an iteration of nodes in any order, and returns as output an iteration of the same nodes in document order, eliminating any duplicates.
Constructor Summary
DocumentOrderIterator(SequenceIterator base, NodeOrderComparer comparer)
Iterate over a sequence in document order.
Method Summary
voidclose()
intcompare(int a, int b)
Compare two nodes in document sequence (needed to implement the Sortable interface)
Itemcurrent()
SequenceIteratorgetAnother()
intgetProperties()
Get properties of this iterator, as a bit-significant integer.
Itemnext()
intposition()
voidswap(int a, int b)
Swap two nodes (needed to implement the Sortable interface)

Constructor Detail

DocumentOrderIterator

public DocumentOrderIterator(SequenceIterator base, NodeOrderComparer comparer)
Iterate over a sequence in document order.

Method Detail

close

public void close()

compare

public int compare(int a, int b)
Compare two nodes in document sequence (needed to implement the Sortable interface)

current

public Item current()

getAnother

public SequenceIterator getAnother()

getProperties

public int getProperties()
Get properties of this iterator, as a bit-significant integer.

Returns: the properties of this iterator. This will be some combination of properties such as DocumentOrderIterator, DocumentOrderIterator, and DocumentOrderIterator. 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.

next

public Item next()

position

public int position()

swap

public void swap(int a, int b)
Swap two nodes (needed to implement the Sortable interface)