|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
org.zkoss.util.TreeArray
org.zkoss.util.CheckableTreeArray
public abstract class CheckableTreeArray
The checkable TreeArray. It extends TreeArray such that deriving classes could add validation when an element is added, removed or set. It is also useful to maintain the modification flag.
Nested Class Summary | |
---|---|
protected class |
CheckableTreeArray.CkEntry
|
Nested classes/interfaces inherited from class org.zkoss.util.TreeArray |
---|
TreeArray.RbEntry |
Nested classes/interfaces inherited from interface org.zkoss.util.ListX |
---|
ListX.Entry |
Field Summary |
---|
Fields inherited from class org.zkoss.util.TreeArray |
---|
_hashCode, _root, _size, BLACK, RED |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
protected |
CheckableTreeArray()
|
protected |
CheckableTreeArray(java.util.Collection c)
|
Method Summary | |
---|---|
void |
clear()
Clears the whole list. |
protected void |
delete(TreeArray.RbEntry p)
All remove methods are done thru this method. |
protected TreeArray.RbEntry |
insert(TreeArray.RbEntry insertBefore,
TreeArray.RbEntry p)
All add methods are done thru this method. |
protected TreeArray.RbEntry |
newEntry(java.lang.Object element)
Creates an instance of RbEntry. |
protected void |
onAdd(java.lang.Object newElement,
java.lang.Object followingElement)
Called each time an new element is about being added into the array. |
protected void |
onRemove(java.lang.Object element)
Called each time an element is about being removed from the array. |
protected void |
onSet(java.lang.Object newElement,
java.lang.Object replaced)
Called each time an element is about being assigned into the array and replace an existence one (by ListIterator.set). |
Methods inherited from class org.zkoss.util.TreeArray |
---|
add, addAllByOrder, addAllByOrder, addByOrder, addByOrder, addEntry, addEntry, addEntry, checkNotOrphan, checkRange, checkRangePlus, clone, decSize, delete, entryIterator, entryIterator, first, get, getByOrder, getByOrder, getEntry, getRbEntry, hashCode, incSize, indexOfEntry, indexOfEntry, indexOutOfBounds, insert, iterator, listIterator, remove, removeByOrder, removeByOrder, removeEntry, removeEntry, search, search, set, size, sort, sort |
Methods inherited from class java.util.AbstractList |
---|
add, addAll, equals, indexOf, lastIndexOf, listIterator, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
protected CheckableTreeArray()
protected CheckableTreeArray(java.util.Collection c)
Method Detail |
---|
protected void onAdd(java.lang.Object newElement, java.lang.Object followingElement)
Deriving classes usually put checking codes here. And, throws exception if failure and nothing will be affected.
newElement
- the element to be addedfollowingElement
- the elment that will 'follow' the new element.
In other words, newElement will be inserted before
followingElement. If null, it means newElement is appended at the endprotected void onSet(java.lang.Object newElement, java.lang.Object replaced)
Deriving classes usually put checking codes here. And, throws exception if failure and nothing will be affected.
newElement
- the element to be addedreplaced
- the element to be replacedprotected void onRemove(java.lang.Object element)
protected TreeArray.RbEntry newEntry(java.lang.Object element)
TreeArray
newEntry
in class TreeArray
protected TreeArray.RbEntry insert(TreeArray.RbEntry insertBefore, TreeArray.RbEntry p)
TreeArray
Note: p is inserted before insertBefore.
insert
in class TreeArray
protected void delete(TreeArray.RbEntry p)
TreeArray
delete
in class TreeArray
public void clear()
TreeArray
Note clear actually invokes RbEntry.clear to do the real cleanup. Deriving classes might override RbEntry.clear.
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class TreeArray
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |