org.apache.xalan.templates
Class RedundentExprEliminator.MultistepExprHolder

java.lang.Object
  extended by org.apache.xalan.templates.RedundentExprEliminator.MultistepExprHolder
All Implemented Interfaces:
java.lang.Cloneable
Enclosing class:
RedundentExprEliminator

 class RedundentExprEliminator.MultistepExprHolder
extends java.lang.Object
implements java.lang.Cloneable

Since we want to sort multistep expressions by length, use a linked list with elements of type MultistepExprHolder.


Field Summary
(package private)  ExpressionOwner m_exprOwner
           
(package private)  RedundentExprEliminator.MultistepExprHolder m_next
           
(package private)  int m_stepCount
           
 
Constructor Summary
RedundentExprEliminator.MultistepExprHolder(ExpressionOwner exprOwner, int stepCount, RedundentExprEliminator.MultistepExprHolder next)
          Create a MultistepExprHolder.
 
Method Summary
(package private)  RedundentExprEliminator.MultistepExprHolder addInSortedOrder(ExpressionOwner exprOwner, int stepCount)
          Add a new MultistepExprHolder in sorted order in the list.
 java.lang.Object clone()
          Clone this object.
protected  void diagnose()
          Print diagnostics out for the multistep list.
(package private)  int getLength()
          Get the number of linked list items.
(package private)  RedundentExprEliminator.MultistepExprHolder unlink(RedundentExprEliminator.MultistepExprHolder itemToRemove)
          Remove the given element from the list.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_exprOwner

ExpressionOwner m_exprOwner

m_stepCount

final int m_stepCount

m_next

RedundentExprEliminator.MultistepExprHolder m_next
Constructor Detail

RedundentExprEliminator.MultistepExprHolder

RedundentExprEliminator.MultistepExprHolder(ExpressionOwner exprOwner,
                                            int stepCount,
                                            RedundentExprEliminator.MultistepExprHolder next)
Create a MultistepExprHolder.

Parameters:
exprOwner - the owner of the expression we are holding. It must hold a LocationPathIterator.
stepCount - The number of steps in the location path.
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone this object.

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

addInSortedOrder

RedundentExprEliminator.MultistepExprHolder addInSortedOrder(ExpressionOwner exprOwner,
                                                             int stepCount)
Add a new MultistepExprHolder in sorted order in the list.

Parameters:
exprOwner - the owner of the expression we are holding. It must hold a LocationPathIterator.
stepCount - The number of steps in the location path.
Returns:
The new head of the linked list.

unlink

RedundentExprEliminator.MultistepExprHolder unlink(RedundentExprEliminator.MultistepExprHolder itemToRemove)
Remove the given element from the list. 'this' should be the head of the list. If the item to be removed is not found, an assertion will be made.

Parameters:
itemToRemove - The item to remove from the list.
Returns:
The head of the list, which may have changed if itemToRemove is the same as this element. Null if the item to remove is the only item in the list.

getLength

int getLength()
Get the number of linked list items.


diagnose

protected void diagnose()
Print diagnostics out for the multistep list.