Package org.zkoss.util
Class NotableLinkedList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- org.zkoss.util.NotableLinkedList<E>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
- Direct Known Subclasses:
AbstractGroup.ChildArray
,Document.ChildArray
,Element.AttrArray
public class NotableLinkedList<E> extends java.util.AbstractSequentialList<E> implements java.util.List<E>, java.lang.Cloneable, java.io.Serializable
Linked list implementation of the List interface that provides the callback methods such asonAdd(E, E)
,onSet(E, E)
andonRemove(E)
.- Since:
- 5.0.8
- Author:
- tomyeh
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NotableLinkedList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ListIterator<E>
listIterator(int index)
protected void
onAdd(E newElement, E followingElement)
Called each time an new element is about being added into the array.protected void
onRemove(E element)
Called each time an element is about being removed from the array.protected void
onSet(E newElement, E 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 class java.util.AbstractSequentialList
add, addAll, get, iterator, remove, set
-
Methods inherited from class java.util.AbstractList
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Method Detail
-
size
public int size()
-
listIterator
public java.util.ListIterator<E> listIterator(int index)
-
onAdd
protected void onAdd(E newElement, E 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 element 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(E newElement, E 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(E 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.
-
-