org.apache.xml.dtm.ref
Class DTMDefaultBaseTraversers.IndexedDTMAxisTraverser

java.lang.Object
  extended byorg.apache.xml.dtm.DTMAxisTraverser
      extended byorg.apache.xml.dtm.ref.DTMDefaultBaseTraversers.IndexedDTMAxisTraverser
Direct Known Subclasses:
DTMDefaultBaseTraversers.DescendantTraverser
Enclosing class:
DTMDefaultBaseTraversers

private abstract class DTMDefaultBaseTraversers.IndexedDTMAxisTraverser
extends DTMAxisTraverser

Super class for derived classes that want a convenient way to access the indexing mechanism.


Constructor Summary
private DTMDefaultBaseTraversers.IndexedDTMAxisTraverser()
           
 
Method Summary
protected abstract  boolean axisHasBeenProcessed(int axisRoot)
          Tell if the axis has been fully processed to tell if a the wait for an arriving node should terminate.
protected  int getNextIndexed(int axisRoot, int nextPotential, int expandedTypeID)
          Get the next indexed node that matches the expanded type ID.
protected abstract  boolean isAfterAxis(int axisRoot, int identity)
          Tell if a node is outside the axis being traversed.
protected  boolean isIndexed(int expandedTypeID)
          Tell if the indexing is on and the given expanded type ID matches what is in the indexes.
 
Methods inherited from class org.apache.xml.dtm.DTMAxisTraverser
first, first, next, next
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTMDefaultBaseTraversers.IndexedDTMAxisTraverser

private DTMDefaultBaseTraversers.IndexedDTMAxisTraverser()
Method Detail

isIndexed

protected final boolean isIndexed(int expandedTypeID)
Tell if the indexing is on and the given expanded type ID matches what is in the indexes. Derived classes should call this before calling getNextIndexed method.

Parameters:
expandedTypeID - The expanded type ID being requested.
Returns:
true if it is OK to call the getNextIndexed method.

isAfterAxis

protected abstract boolean isAfterAxis(int axisRoot,
                                       int identity)
Tell if a node is outside the axis being traversed. This method must be implemented by derived classes, and must be robust enough to handle any node that occurs after the axis root.

Parameters:
axisRoot - The root identity of the axis.
identity - The node in question.
Returns:
true if the given node falls outside the axis being traversed.

axisHasBeenProcessed

protected abstract boolean axisHasBeenProcessed(int axisRoot)
Tell if the axis has been fully processed to tell if a the wait for an arriving node should terminate. This method must be implemented be a derived class.

Parameters:
axisRoot - The root identity of the axis.
Returns:
true if the axis has been fully processed.

getNextIndexed

protected int getNextIndexed(int axisRoot,
                             int nextPotential,
                             int expandedTypeID)
Get the next indexed node that matches the expanded type ID. Before calling this function, one should first call isIndexed to make sure that the index can contain nodes that match the given expanded type ID.

Parameters:
axisRoot - The root identity of the axis.
nextPotential - The node found must match or occur after this node.
expandedTypeID - The expanded type ID for the request.
Returns:
The node ID or NULL if not found.