org.apache.xalan.templates
Class RedundentExprEliminator.MultistepExprHolder

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

class RedundentExprEliminator.MultistepExprHolder
extends Object
implements 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
(package private) 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.
 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 Object clone()
             throws CloneNotSupportedException
Clone this object.

Overrides:
clone in class Object
Returns:
a clone of this instance.
Throws:
CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
See Also:
Cloneable

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.