org.apache.xml.dtm.ref.sax2dtm

Class SAX2DTM2.PrecedingIterator

Enclosing Class:
SAX2DTM2
Implemented Interfaces:
Cloneable, DTMAxisIterator
Known Direct Subclasses:
SAX2DTM2.TypedPrecedingIterator

public class SAX2DTM2.PrecedingIterator
extends DTMDefaultBaseIterators.InternalAxisIteratorBase

Iterator that returns preceding nodes of a given node. This includes the node set {root+1, start-1}, but excludes all ancestors, attributes, and namespace nodes.

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

END

Method Summary

DTMAxisIterator
cloneIterator()
Returns a deep copy of this iterator.
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.


gotoMark

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


isReverse

public 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.