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

java.lang.Object
  extended by org.apache.xml.dtm.DTMAxisTraverser
      extended by org.apache.xml.dtm.ref.DTMDefaultBaseTraversers.PrecedingTraverser
Enclosing class:
DTMDefaultBaseTraversers

private class DTMDefaultBaseTraversers.PrecedingTraverser
extends DTMAxisTraverser

Implements traversal of the Ancestor access, in reverse document order.


Constructor Summary
private DTMDefaultBaseTraversers.PrecedingTraverser()
           
 
Method Summary
protected  boolean isAncestor(int contextIdent, int currentIdent)
          Tell if the current identity is an ancestor of the context identity.
 int next(int context, int current)
          Traverse to the next node after the current node.
 int next(int context, int current, int expandedTypeID)
          Traverse to the next node after the current node that is matched by the expanded type ID.
 
Methods inherited from class org.apache.xml.dtm.DTMAxisTraverser
first, first
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTMDefaultBaseTraversers.PrecedingTraverser

private DTMDefaultBaseTraversers.PrecedingTraverser()
Method Detail

isAncestor

protected boolean isAncestor(int contextIdent,
                             int currentIdent)
Tell if the current identity is an ancestor of the context identity. This is an expensive operation, made worse by the stateless traversal. But the preceding axis is used fairly infrequently.

Parameters:
contextIdent - The context node of the axis traversal.
currentIdent - The node in question.
Returns:
true if the currentIdent node is an ancestor of contextIdent.

next

public int next(int context,
                int current)
Traverse to the next node after the current node.

Specified by:
next in class DTMAxisTraverser
Parameters:
context - The context node of this iteration.
current - The current node of the iteration.
Returns:
the next node in the iteration, or DTM.NULL.
See Also:
DTMAxisTraverser.first(int)

next

public int next(int context,
                int current,
                int expandedTypeID)
Traverse to the next node after the current node that is matched by the expanded type ID.

Specified by:
next in class DTMAxisTraverser
Parameters:
context - The context node of this iteration.
current - The current node of the iteration.
expandedTypeID - The expanded type ID that must match.
Returns:
the next node in the iteration, or DTM.NULL.
See Also:
DTMAxisTraverser.first(int,int)