Package net.sf.saxon.om
Class ReverseNodeArrayIterator
- java.lang.Object
-
- net.sf.saxon.om.ReverseArrayIterator
-
- net.sf.saxon.om.ReverseNodeArrayIterator
-
- All Implemented Interfaces:
LastPositionFinder,ReversibleIterator,AxisIterator,LookaheadIterator,SequenceIterator,UnfailingIterator
public class ReverseNodeArrayIterator extends ReverseArrayIterator implements AxisIterator
Iterator over an array of nodes in reverse order
-
-
Field Summary
-
Fields inherited from interface net.sf.saxon.om.SequenceIterator
GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD
-
-
Constructor Summary
Constructors Constructor Description ReverseNodeArrayIterator(Item[] items, int start, int end)Create a reverse iterator over a slice of an array
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Valueatomize()Return the atomized value of the current node.SequenceIteratorgetAnother()Get another iterator over the same itemsSequenceIteratorgetReverseIterator()Get an iterator that processes the same items in reverse order.java.lang.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.-
Methods inherited from class net.sf.saxon.om.ReverseArrayIterator
close, current, getLastPosition, getProperties, hasNext, next, position
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.SequenceIterator
close, getProperties
-
Methods inherited from interface net.sf.saxon.om.UnfailingIterator
current, next, position
-
-
-
-
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 itemsstart- 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
-
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.- Specified by:
moveNextin interfaceAxisIterator
-
iterateAxis
public AxisIterator iterateAxis(byte axis, NodeTest test)
Return an iterator over an axis, starting at the current node.- Specified by:
iterateAxisin interfaceAxisIterator- Parameters:
axis- the axis to iterate over, using a constant such asAxis.CHILDtest- a predicate to apply to the nodes before returning them.- Throws:
java.lang.NullPointerException- if there is no current node
-
atomize
public Value atomize() throws XPathException
Return the atomized value of the current node.- Specified by:
atomizein interfaceAxisIterator- Returns:
- the atomized value.
- Throws:
java.lang.NullPointerException- if there is no current nodeXPathException
-
getStringValue
public java.lang.CharSequence getStringValue()
Return the string value of the current node.- Specified by:
getStringValuein interfaceAxisIterator- Returns:
- the string value, as an instance of CharSequence.
- Throws:
java.lang.NullPointerException- if there is no current node
-
getAnother
public SequenceIterator getAnother()
Get another iterator over the same items- Specified by:
getAnotherin interfaceSequenceIterator- Specified by:
getAnotherin interfaceUnfailingIterator- Overrides:
getAnotherin classReverseArrayIterator- 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.- Specified by:
getReverseIteratorin interfaceReversibleIterator- Overrides:
getReverseIteratorin classReverseArrayIterator- Returns:
- a new ArrayIterator
-
-