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:
Serializable,Cloneable,Iterable<E>,Collection<E>,List<E>
- Direct Known Subclasses:
AbstractGroup.ChildArray,Document.ChildArray,Element.AttrArray
public class NotableLinkedList<E>
extends AbstractSequentialList<E>
implements List<E>, Cloneable, Serializable
Linked list implementation of the List interface
that provides the callback methods such as
onAdd(E, E), onSet(E, E)
and onRemove(E).- Since:
- 5.0.8
- Author:
- tomyeh
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlistIterator(int index) protected voidCalled each time an new element is about being added into the array.protected voidCalled each time an element is about being removed from the array.protected voidCalled each time an element is about being assigned into the array and replace an existence one (by ListIterator.set).intsize()Methods inherited from class java.util.AbstractSequentialList
add, addAll, get, iterator, remove, setMethods inherited from class java.util.AbstractList
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
NotableLinkedList
public NotableLinkedList()
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classAbstractCollection<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>- Specified by:
listIteratorin classAbstractSequentialList<E>
-
onAdd
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
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
Called each time an element is about being removed from the array. Deriving classes usually put checking codes here. And, throws exception if failure.
-