org.apache.xalan.xsltc.dom
Class SimpleResultTreeImpl.SimpleIterator

java.lang.Object
  extended by org.apache.xml.dtm.ref.DTMAxisIteratorBase
      extended by org.apache.xalan.xsltc.dom.SimpleResultTreeImpl.SimpleIterator
All Implemented Interfaces:
java.lang.Cloneable, DTMAxisIterator
Enclosing class:
SimpleResultTreeImpl

public final class SimpleResultTreeImpl.SimpleIterator
extends DTMAxisIteratorBase

The SimpleIterator is designed to support the nodeset() extension function. It has a traversal direction parameter. The DOWN direction is used for child and descendant axes, while the UP direction is used for parent and ancestor axes. This iterator only handles two nodes (RTF_ROOT and RTF_TEXT). If the type is set, it will also match the node type with the given type.


Field Summary
(package private)  int _currentNode
           
(package private)  int _direction
           
(package private)  int _type
           
(package private) static int DIRECTION_DOWN
           
(package private) static int DIRECTION_UP
           
(package private) static int NO_TYPE
           
 
Fields inherited from class org.apache.xml.dtm.ref.DTMAxisIteratorBase
_includeSelf, _isRestartable, _last, _markedNode, _position, _startNode
 
Fields inherited from interface org.apache.xml.dtm.DTMAxisIterator
END
 
Constructor Summary
SimpleResultTreeImpl.SimpleIterator()
           
SimpleResultTreeImpl.SimpleIterator(int direction)
           
SimpleResultTreeImpl.SimpleIterator(int direction, int type)
           
 
Method Summary
 void gotoMark()
          Restores the current node remembered by setMark().
 int next()
          Get the next node in the iteration.
 void setMark()
          Remembers the current node for the next call to gotoMark().
 DTMAxisIterator setStartNode(int nodeHandle)
          Set start to END should 'close' the iterator, i.e.
 
Methods inherited from class org.apache.xml.dtm.ref.DTMAxisIteratorBase
cloneIterator, getAxis, getLast, getNodeByPosition, getPosition, getStartNode, includeSelf, isDocOrdered, isReverse, reset, resetPosition, returnNode, setRestartable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTION_UP

static final int DIRECTION_UP
See Also:
Constant Field Values

DIRECTION_DOWN

static final int DIRECTION_DOWN
See Also:
Constant Field Values

NO_TYPE

static final int NO_TYPE
See Also:
Constant Field Values

_direction

int _direction

_type

int _type

_currentNode

int _currentNode
Constructor Detail

SimpleResultTreeImpl.SimpleIterator

public SimpleResultTreeImpl.SimpleIterator()

SimpleResultTreeImpl.SimpleIterator

public SimpleResultTreeImpl.SimpleIterator(int direction)

SimpleResultTreeImpl.SimpleIterator

public SimpleResultTreeImpl.SimpleIterator(int direction,
                                           int type)
Method Detail

next

public int next()
Description copied from interface: DTMAxisIterator
Get the next node in the iteration.

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

setStartNode

public DTMAxisIterator setStartNode(int nodeHandle)
Description copied from interface: DTMAxisIterator
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

Parameters:
nodeHandle - Sets the root of the iteration.
Returns:
A DTMAxisIterator set to the start of the iteration.

setMark

public void setMark()
Description copied from interface: DTMAxisIterator
Remembers the current node for the next call to gotoMark().


gotoMark

public void gotoMark()
Description copied from interface: DTMAxisIterator
Restores the current node remembered by setMark().