Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.xalan.xsltc.dom
Class StepIterator  view StepIterator download StepIterator.java

java.lang.Object
  extended byorg.apache.xml.dtm.ref.DTMAxisIteratorBase
      extended byorg.apache.xalan.xsltc.dom.StepIterator
All Implemented Interfaces:
java.lang.Cloneable, org.apache.xml.dtm.DTMAxisIterator
Direct Known Subclasses:
FilteredStepIterator

public class StepIterator
extends org.apache.xml.dtm.ref.DTMAxisIteratorBase

A step iterator is used to evaluate expressions like "BOOK/TITLE". A better name for this iterator would have been ParentIterator since both "BOOK" and "TITLE" are steps in XPath lingo. Step iterators are constructed from two other iterators which we are going to refer to as "outer" and "inner". Every node from the outer iterator (the one for BOOK in our example) is used to initialize the inner iterator. After this initialization, every node from the inner iterator is returned (in essence, implementing a "nested loop").


Field Summary
protected  org.apache.xml.dtm.DTMAxisIterator _iterator
          A reference to the "inner" iterator.
private  int _pos
          Temp variable to store a marked position.
protected  org.apache.xml.dtm.DTMAxisIterator _source
          A reference to the "outer" iterator.
 
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
StepIterator(org.apache.xml.dtm.DTMAxisIterator source, org.apache.xml.dtm.DTMAxisIterator iterator)
           
 
Method Summary
 org.apache.xml.dtm.DTMAxisIterator cloneIterator()
          Returns a deep copy of this iterator.
 void gotoMark()
          Restores the current node remembered by setMark().
 int next()
          Get the next node in the iteration.
 org.apache.xml.dtm.DTMAxisIterator reset()
          Resets the iterator to the last start node.
 void setMark()
          Remembers the current node for the next call to gotoMark().
 void setRestartable(boolean isRestartable)
          Set if restartable.
 org.apache.xml.dtm.DTMAxisIterator setStartNode(int node)
          Set start to END should 'close' the iterator, i.e.
 
Methods inherited from class org.apache.xml.dtm.ref.DTMAxisIteratorBase
getAxis, getLast, getNodeByPosition, getPosition, getStartNode, includeSelf, isDocOrdered, isReverse, resetPosition, returnNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_source

protected org.apache.xml.dtm.DTMAxisIterator _source
A reference to the "outer" iterator.


_iterator

protected org.apache.xml.dtm.DTMAxisIterator _iterator
A reference to the "inner" iterator.


_pos

private int _pos
Temp variable to store a marked position.

Constructor Detail

StepIterator

public StepIterator(org.apache.xml.dtm.DTMAxisIterator source,
                    org.apache.xml.dtm.DTMAxisIterator iterator)
Method Detail

setRestartable

public void setRestartable(boolean isRestartable)
Description copied from interface: org.apache.xml.dtm.DTMAxisIterator
Set if restartable.


cloneIterator

public org.apache.xml.dtm.DTMAxisIterator cloneIterator()
Description copied from class: org.apache.xml.dtm.ref.DTMAxisIteratorBase
Returns a deep copy of this iterator. Cloned iterators may not be restartable. The iterator being cloned may or may not become non-restartable as a side effect of this operation.


setStartNode

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


reset

public org.apache.xml.dtm.DTMAxisIterator reset()
Description copied from interface: org.apache.xml.dtm.DTMAxisIterator
Resets the iterator to the last start node.


next

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


setMark

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


gotoMark

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