protected class ObservableList.ObservableSubList extends ObservableList<E>
ObservableList
that delegates callback methods to the
parent ObservableList
instance for the retrieval, addition, and
removal of elements.ObservableList.ObservableListIterator, ObservableList.ObservableSubList
target
modCount
Modifier | Constructor and Description |
---|---|
protected |
ObservableSubList(List<E> list,
int fromIndex,
int toIndex)
Creates a new
ObservableList.ObservableSubList for
the specified List<E> . |
Modifier and Type | Method and Description |
---|---|
protected void |
afterAdd(int index,
E element,
RuntimeException e)
Callback method that is invoked immediately after an element is added to
the enclosed
List . |
protected void |
afterGet(int index,
E element,
ListIterator<? super E> iterator,
RuntimeException e)
Callback method that is invoked immediately after an element is retrieved
from the enclosed
List . |
protected void |
afterRemove(Object element,
RuntimeException e)
Callback method that is invoked immediately after an element is removed
from the enclosed
List . |
protected void |
afterSet(int index,
E oldElement,
RuntimeException e)
Callback method that is invoked immediately after an element is set at an
index to the enclosed
List . |
protected boolean |
beforeAdd(int index,
E element)
Callback method that is invoked immediately before an element is added to
the enclosed
List . |
protected void |
beforeGet(int index,
ListIterator<E> iterator)
Callback method that is invoked immediately before an element is retrieved
from the enclosed
List . |
protected boolean |
beforeRemove(int index)
Callback method that is invoked immediately before an element is removed
from the enclosed
List . |
protected boolean |
beforeSet(int index,
E newElement)
Callback method that is invoked immediately before an element is set at an
index in the enclosed
List . |
add, add, addAll, addAll, addFast, clear, contains, containsAll, equals, forEach, get, getFast, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, newListIterator, newSubList, parallelStream, remove, remove, removeAll, removeFast, removeIf, replaceAll, retainAll, set, size, sort, spliterator, stream, subList, toArray, toArray, toString
isEmpty, superForEach, superParallelStream, superRemoveIf, superReplaceAll, superSort, superSpliterator, superStream
removeRange
protected ObservableSubList(List<E> list, int fromIndex, int toIndex)
ObservableList.ObservableSubList
for
the specified List<E>
.list
- The List<E>
.fromIndex
- The starting index as the lower limit of the elements in
the target list, inclusive.toIndex
- The starting index as the upper limit of the elements in
the target list, exclusive.NullPointerException
- If the specified List<E>
is null.protected void beforeGet(int index, ListIterator<E> iterator)
ObservableList
List
.beforeGet
in class ObservableList<E>
index
- The index of the element to be retrieved from the enclosed
List
.iterator
- The ListIterator
instance if the get is a result of
an iterator reference, otherwise null
.protected void afterGet(int index, E element, ListIterator<? super E> iterator, RuntimeException e)
ObservableList
List
.afterGet
in class ObservableList<E>
index
- The index of the element retrieved from the enclosed
List
.element
- The element retrieved from the enclosed List
.iterator
- The Iterator
instance if the get is a result of an
iterator reference, otherwise null
.e
- A RuntimeException
that occurred during the get operation,
or null
if no exception occurred.protected boolean beforeAdd(int index, E element)
ObservableList
List
.
Note: It is possible for index
to be -1
, in case the
add operation is executed from an Iterator
when a prior
Iterator.remove()
or ListIterator.add(Object)
or
ListIterator.set(Object)
has already been called.
beforeAdd
in class ObservableList<E>
index
- The index for the element to be added to the enclosed
List
.element
- The element to be added to the enclosed List
.true
, the subsequent add
operation will be performed; if this method returns false
,
the subsequent add operation will not be performed.protected void afterAdd(int index, E element, RuntimeException e)
ObservableList
List
.afterAdd
in class ObservableList<E>
index
- The index of the element added to the enclosed List
.element
- The element to be added to the enclosed List
.e
- A RuntimeException
that occurred during the add operation,
or null
if no exception occurred.protected boolean beforeRemove(int index)
ObservableList
List
.
Note: It is possible for index
to be -1
, in case the
remove operation is executed from an Iterator
when a prior
Iterator.remove()
or ListIterator.add(Object)
or
ListIterator.set(Object)
has already been called.
beforeRemove
in class ObservableList<E>
index
- The index of the element to be removed from the enclosed
List
.true
, the subsequent remove
operation will be performed; if this method returns false
,
the subsequent remove operation will not be performed.protected void afterRemove(Object element, RuntimeException e)
ObservableList
List
.afterRemove
in class ObservableList<E>
element
- The element removed from the enclosed List
, or
attempted to be removed from the List
in case of a
RuntimeException
.e
- A RuntimeException
that occurred during the remove
operation, or null
if no exception occurred.protected boolean beforeSet(int index, E newElement)
ObservableList
List
.
Note: It is possible for index
to be -1
, in case the
set operation is executed from an Iterator
when a prior
Iterator.remove()
or ListIterator.add(Object)
or
ListIterator.set(Object)
has already been called.
beforeSet
in class ObservableList<E>
index
- The index for the element to be set in the enclosed
List
.newElement
- The element to be set in the enclosed List
.true
, the subsequent set
operation will be performed; if this method returns false
,
the subsequent set operation will not be performed.protected void afterSet(int index, E oldElement, RuntimeException e)
ObservableList
List
.afterSet
in class ObservableList<E>
index
- The index of the element set in the enclosed List
.oldElement
- The old element at the index of the enclosed
List
.e
- A RuntimeException
that occurred during the set
operation, or null
if no exception occurred.Copyright © 2020 LibJ. All rights reserved.