net.sf.saxon.om

Class ReverseNodeArrayIterator

public class ReverseNodeArrayIterator extends ReverseArrayIterator implements AxisIterator

Iterator over an array of nodes in reverse order
Constructor Summary
ReverseNodeArrayIterator(Item[] items, int start, int end)
Create a reverse iterator over a slice of an array
Method Summary
Valueatomize()
Return the atomized value of the current node.
SequenceIteratorgetAnother()
Get another iterator over the same items
SequenceIteratorgetReverseIterator()
Get an iterator that processes the same items in reverse order.
CharSequencegetStringValue()
Return the string value of the current node.
AxisIteratoriterateAxis(byte axis, NodeTest test)
Return an iterator over an axis, starting at the current node.
booleanmoveNext()
Move to the next node, without returning it.

Constructor Detail

ReverseNodeArrayIterator

public ReverseNodeArrayIterator(Item[] items, int start, int end)
Create a reverse iterator over a slice of an array

Parameters: items The array of items start The first item in the array to be be used (this will be the last one in the resulting iteration). Zero-based. end The item after the last one in the array to be used (this will be the first one to be returned by the iterator). Zero-based.

Method Detail

atomize

public Value atomize()
Return the atomized value of the current node.

Returns: the atomized value.

Throws: NullPointerException if there is no current node

getAnother

public SequenceIterator getAnother()
Get another iterator over the same items

Returns: another iterator over the same items, positioned at the start of the sequence

getReverseIterator

public SequenceIterator getReverseIterator()
Get an iterator that processes the same items in reverse order. Since this iterator is processing the items backwards, this method returns an ArrayIterator that processes them forwards.

Returns: a new ArrayIterator

getStringValue

public CharSequence getStringValue()
Return the string value of the current node.

Returns: the string value, as an instance of CharSequence.

Throws: NullPointerException if there is no current node

iterateAxis

public AxisIterator iterateAxis(byte axis, NodeTest test)
Return an iterator over an axis, starting at the current node.

Parameters: axis the axis to iterate over, using a constant such as CHILD test a predicate to apply to the nodes before returning them.

Throws: NullPointerException if there is no current node

moveNext

public boolean moveNext()
Move to the next node, without returning it. Returns true if there is a next node, false if the end of the sequence has been reached. After calling this method, the current node may be retrieved using the current() function.