org.apache.xml.dtm.ref

Class DTMDefaultBaseIterators.AncestorIterator

Enclosing Class:
DTMDefaultBaseIterators
Implemented Interfaces:
Cloneable, DTMAxisIterator
Known Direct Subclasses:
DTMDefaultBaseIterators.TypedAncestorIterator

public class DTMDefaultBaseIterators.AncestorIterator
extends DTMDefaultBaseIterators.InternalAxisIteratorBase

Iterator that returns the ancestors of a given node in document order. (NOTE! This was changed from the XSLTC code!)

Fields inherited from interface org.apache.xml.dtm.DTMAxisIterator

END

Method Summary

DTMAxisIterator
cloneIterator()
Returns a deep copy of this iterator.
int
getStartNode()
Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
void
gotoMark()
boolean
isReverse()
True if this iterator has a reversed axis.
int
next()
Get the next node in the iteration.
DTMAxisIterator
reset()
Resets the iterator to the last start node.
void
setMark()
DTMAxisIterator
setStartNode(int node)
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

Methods inherited from class org.apache.xml.dtm.ref.DTMDefaultBaseIterators.InternalAxisIteratorBase

gotoMark, setMark

Methods inherited from class org.apache.xml.dtm.ref.DTMAxisIteratorBase

cloneIterator, getAxis, getLast, getNodeByPosition, getPosition, getStartNode, includeSelf, isDocOrdered, isReverse, reset, setRestartable

Method Details

cloneIterator

public DTMAxisIterator cloneIterator()
Returns a deep copy of this iterator. The cloned iterator is not reset.
Specified by:
cloneIterator in interface DTMAxisIterator
Overrides:
cloneIterator in interface DTMAxisIteratorBase
Returns:
a deep copy of this iterator.

getStartNode

public int getStartNode()
Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
Specified by:
getStartNode in interface DTMAxisIterator
Overrides:
getStartNode in interface DTMAxisIteratorBase
Returns:
The root node of the iteration.

gotoMark

public void gotoMark()
Specified by:
gotoMark in interface DTMAxisIterator
Overrides:
gotoMark in interface DTMDefaultBaseIterators.InternalAxisIteratorBase

isReverse

public final boolean isReverse()
True if this iterator has a reversed axis.
Specified by:
isReverse in interface DTMAxisIterator
Overrides:
isReverse in interface DTMAxisIteratorBase
Returns:
true since this iterator is a reversed axis.

next

public int next()
Get the next node in the iteration.
Specified by:
next in interface DTMAxisIterator
Returns:
The next node handle in the iteration, or END.

reset

public DTMAxisIterator reset()
Resets the iterator to the last start node.
Specified by:
reset in interface DTMAxisIterator
Overrides:
reset in interface DTMAxisIteratorBase
Returns:
A DTMAxisIterator, which may or may not be the same as this iterator.

setMark

public void setMark()
Specified by:
setMark in interface DTMAxisIterator
Overrides:
setMark in interface DTMDefaultBaseIterators.InternalAxisIteratorBase

setStartNode

public DTMAxisIterator setStartNode(int node)
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
Specified by:
setStartNode in interface DTMAxisIterator
Parameters:
node - Sets the root of the iteration.
Returns:
A DTMAxisIterator set to the start of the iteration.

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