public class NotableLinkedList<E>
extends java.util.AbstractSequentialList<E>
implements java.util.List<E>, java.lang.Cloneable, java.io.Serializable
onAdd(E, E)
, onSet(E, E)
and onRemove(E)
.Constructor and Description |
---|
NotableLinkedList() |
Modifier and Type | Method and 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() |
add, addAll, get, iterator, remove, set
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public int size()
public java.util.ListIterator<E> listIterator(int index)
protected void onAdd(E newElement, E 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 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 endprotected void onSet(E newElement, E 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(E element)
Copyright © 2005-2018 Potix Corporation. All Rights Reserved.