org.apache.xml.dtm

Interface DTMAxisIterator

public interface DTMAxisIterator extends Cloneable

This class iterates over a single XPath Axis, and returns node handles.
Field Summary
static intEND
Specifies the end of the iteration, and is the same as DTM.NULL.
Method Summary
DTMAxisIteratorcloneIterator()
intgetLast()
intgetNodeByPosition(int position)
Return the node at the given position.
intgetPosition()
intgetStartNode()
Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
voidgotoMark()
Restores the current node remembered by setMark().
booleanisReverse()
intnext()
Get the next node in the iteration.
DTMAxisIteratorreset()
Resets the iterator to the last start node.
voidsetMark()
Remembers the current node for the next call to gotoMark().
voidsetRestartable(boolean isRestartable)
Set if restartable.
DTMAxisIteratorsetStartNode(int node)
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

Field Detail

END

public static final int END
Specifies the end of the iteration, and is the same as DTM.NULL.

Method Detail

cloneIterator

public DTMAxisIterator cloneIterator()

Returns: a deep copy of this iterator. The clone should not be reset from its current position.

getLast

public int getLast()

Returns: the number of nodes in this iterator. This may be an expensive operation when called the first time.

getNodeByPosition

public int getNodeByPosition(int position)
Return the node at the given position.

Parameters: position The position

Returns: The node at the given position.

getPosition

public int getPosition()

Returns: The position of the current node in the set, as defined by XPath.

getStartNode

public int getStartNode()
Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

Returns: The root node of the iteration.

gotoMark

public void gotoMark()
Restores the current node remembered by setMark().

isReverse

public boolean isReverse()

Returns: true if this iterator has a reversed axis, else false.

next

public int next()
Get the next node in the iteration.

Returns: The next node handle in the iteration, or END.

reset

public DTMAxisIterator reset()
Resets the iterator to the last start node.

Returns: A DTMAxisIterator, which may or may not be the same as this iterator.

setMark

public void setMark()
Remembers the current node for the next call to gotoMark().

setRestartable

public void setRestartable(boolean isRestartable)
Set if restartable.

setStartNode

public DTMAxisIterator setStartNode(int node)
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

Parameters: node Sets the root of the iteration.

Returns: A DTMAxisIterator set to the start of the iteration.

Copyright B) 2006 Apache XML Project. All Rights Reserved.