net.sf.saxon.functions
Class DistinctValues.DistinctIterator
java.lang.Object
net.sf.saxon.functions.DistinctValues.DistinctIterator
- DistinctValues
- SequenceIterator
public static class DistinctValues.DistinctIterator
extends java.lang.Object
Iterator class to return the distinct values in a sequence
Item | current() - Get the current value in the sequence (the one returned by the
most recent call on next()).
|
SequenceIterator | getAnother() - Get another SequenceIterator that iterates over the same items as the original,
but which is repositioned at the start of the sequence.
|
int | getProperties() - Get properties of this iterator, as a bit-significant integer.
|
Item | next() - Get the next item in the sequence.
|
int | position() - Get the current position.
|
DistinctIterator
public DistinctIterator(SequenceIterator base,
AtomicComparer comparer)
Create an iterator over the distinct values in a sequence
base
- the input sequence. This must return atomic values only.comparer
- The comparer used to obtain comparison keys from each value;
these comparison keys are themselves compared using equals().
current
public Item current()
Get the current value in the sequence (the one returned by the
most recent call on next()). This will be null before the first
call of next().
- current in interface SequenceIterator
- the current item, the one most recently returned by a call on
next(); or null, if next() has not been called, or if the end
of the sequence has been reached.
getAnother
public SequenceIterator getAnother()
throws XPathException
Get another SequenceIterator that iterates over the same items as the original,
but which is repositioned at the start of the sequence.
- getAnother in interface SequenceIterator
- a SequenceIterator that iterates over the same items,
positioned before the first item
getProperties
public int getProperties()
Get properties of this iterator, as a bit-significant integer.
- getProperties in interface SequenceIterator
position
public int position()
Get the current position. This will be zero before the first call
on next(), otherwise it will be the number of times that next() has
been called.
- position in interface SequenceIterator
- the current position, the position of the item returned by the
most recent call of next()