org.zkoss.util
Class NotableLinkedList
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.AbstractSequentialList
org.zkoss.util.NotableLinkedList
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable, Collection, List
- Direct Known Subclasses:
- AbstractGroup.ChildArray, Document.ChildArray, Element.AttrArray
public class NotableLinkedList
- extends AbstractSequentialList
- implements List, Cloneable, Serializable
Linked list implementation of the List interface
that provides the callback methods such as onAdd(java.lang.Object, java.lang.Object), onSet(java.lang.Object, java.lang.Object)
and onRemove(java.lang.Object).
- Since:
- 5.0.8
- Author:
- tomyeh
- See Also:
- Serialized Form
|
Method Summary |
ListIterator |
listIterator(int index)
|
protected void |
onAdd(Object newElement,
Object followingElement)
Called each time an new element is about being added into the array. |
protected void |
onRemove(Object element)
Called each time an element is about being removed from the array. |
protected void |
onSet(Object newElement,
Object replaced)
Called each time an element is about being assigned into the array
and replace an existence one (by ListIterator.set). |
int |
size()
|
| Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray |
NotableLinkedList
public NotableLinkedList()
size
public int size()
- Specified by:
size in interface Collection- Specified by:
size in interface List- Specified by:
size in class AbstractCollection
listIterator
public ListIterator listIterator(int index)
- Specified by:
listIterator in interface List- Specified by:
listIterator in class AbstractSequentialList
onAdd
protected void onAdd(Object newElement,
Object followingElement)
- Called each time an new element is about being added into the array.
Deriving classes usually put checking codes here.
And, throws exception if failure and nothing will be affected.
- Parameters:
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 end
onSet
protected void onSet(Object newElement,
Object replaced)
- Called each time an element is about being assigned into the array
and replace an existence one (by ListIterator.set).
Deriving classes usually put checking codes here.
And, throws exception if failure and nothing will be affected.
- Parameters:
newElement - the element to be addedreplaced - the element to be replaced
onRemove
protected void onRemove(Object element)
- Called each time an element is about being removed from the array.
Deriving classes usually put checking codes here.
And, throws exception if failure.
Copyright © 2011. All Rights Reserved.