public class NotableLinkedList<E> extends AbstractSequentialList<E> implements List<E>, Cloneable, Serializable
onAdd(E, E), onSet(E, E)
and onRemove(E).modCount| Constructor and Description |
|---|
NotableLinkedList() |
| Modifier and Type | Method and Description |
|---|---|
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, setadd, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArrayparallelStream, removeIf, streampublic int size()
size in interface Collection<E>size in interface List<E>size in class AbstractCollection<E>public ListIterator<E> listIterator(int index)
listIterator in interface List<E>listIterator in class AbstractSequentialList<E>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 © 2018. All rights reserved.