org.zkoss.util
Class TreeArray.RbEntry

java.lang.Object
  extended by org.zkoss.util.TreeArray.RbEntry
All Implemented Interfaces:
ListX.Entry
Direct Known Subclasses:
CheckableTreeArray.CkEntry
Enclosing class:
TreeArray

protected static class TreeArray.RbEntry
extends java.lang.Object
implements ListX.Entry

Caller shall use AbstractList.Entry instead of RbEntry for better portability.


Field Summary
protected  boolean color
           
protected  java.lang.Object element
           
protected  TreeArray.RbEntry left
           
protected  int leftNum
           
protected  boolean orphan
           
protected  TreeArray.RbEntry parent
           
protected  TreeArray.RbEntry right
           
 
Constructor Summary
protected TreeArray.RbEntry(java.lang.Object element)
           
 
Method Summary
protected  void clear()
          Called by TreeArray.clear to do clear recursively.
protected  TreeArray.RbEntry firstRightAncestor()
          Gets the first parent at the right of the specified entry.
protected  TreeArray.RbEntry firtLeftAncestor()
          Gets the first ancestor at the left of the specified entry.
 java.lang.Object getElement()
          Override it if you want to something when an element is retrieved.
 boolean isOrphan()
          Tests whether an entry is an orphan -- being removed from a list.
protected  TreeArray.RbEntry leftMost()
          Gets the leftmost leaf of the specified subtree.
 ListX.Entry next()
           
protected  TreeArray.RbEntry nextEntry()
           
 ListX.Entry previous()
           
protected  TreeArray.RbEntry previousEntry()
           
protected  TreeArray.RbEntry rightMost()
          Gets the rihtmost leaf of the specified subtree.
 void setElement(java.lang.Object element)
          Override it if you want to do something when an element is set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

element

protected java.lang.Object element

leftNum

protected int leftNum

left

protected TreeArray.RbEntry left

right

protected TreeArray.RbEntry right

parent

protected TreeArray.RbEntry parent

color

protected boolean color

orphan

protected boolean orphan
Constructor Detail

TreeArray.RbEntry

protected TreeArray.RbEntry(java.lang.Object element)
Method Detail

getElement

public java.lang.Object getElement()
Override it if you want to something when an element is retrieved. All other parts that get element must invoke this method

Specified by:
getElement in interface ListX.Entry

setElement

public void setElement(java.lang.Object element)
Override it if you want to do something when an element is set. All other parts that set element will invoke this method.

Specified by:
setElement in interface ListX.Entry

isOrphan

public final boolean isOrphan()
Description copied from interface: ListX.Entry
Tests whether an entry is an orphan -- being removed from a list.

Specified by:
isOrphan in interface ListX.Entry

nextEntry

protected final TreeArray.RbEntry nextEntry()

next

public final ListX.Entry next()
Specified by:
next in interface ListX.Entry

previousEntry

protected final TreeArray.RbEntry previousEntry()

previous

public final ListX.Entry previous()
Specified by:
previous in interface ListX.Entry

leftMost

protected final TreeArray.RbEntry leftMost()
Gets the leftmost leaf of the specified subtree. It is the entry with lowest index in the subtree.


rightMost

protected final TreeArray.RbEntry rightMost()
Gets the rihtmost leaf of the specified subtree. It is the entry with highest index in the subtree.


firtLeftAncestor

protected final TreeArray.RbEntry firtLeftAncestor()
Gets the first ancestor at the left of the specified entry. "At the left" we mean the returned ancesor's right is the entry or its ancestor. It is also the first parent with lower index.


firstRightAncestor

protected final TreeArray.RbEntry firstRightAncestor()
Gets the first parent at the right of the specified entry. "At the right" we mean the returned ancesor's right is the entry or its ancestor. It is also the first parent with higer index.


clear

protected void clear()
Called by TreeArray.clear to do clear recursively. Since it always be invoked to clear the whole tree, it doesn't have to maintain leftNum or other tree info.

However, this.element is kept.



Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo