public class ObservableArrayList<T> extends ArrayList<T> implements ObservableList<T>
ObservableList
implementation using ArrayList as an implementation.ObservableList.OnListChangedCallback<T extends ObservableList>
modCount
Constructor and Description |
---|
ObservableArrayList() |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T object)
Inserts the specified element at the specified position in this
list.
|
boolean |
add(T object)
Appends the specified element to the end of this list.
|
boolean |
addAll(Collection<? extends T> collection)
Appends all of the elements in the specified collection to the end of
this list, in the order that they are returned by the
specified collection's Iterator.
|
boolean |
addAll(int index,
Collection<? extends T> collection)
Inserts all of the elements in the specified collection into this
list, starting at the specified position.
|
void |
addOnListChangedCallback(ObservableList.OnListChangedCallback listener)
Adds a callback to be notified when changes to the list occur.
|
void |
clear()
Removes all of the elements from this list.
|
T |
remove(int index)
Removes the element at the specified position in this list.
|
boolean |
remove(Object object)
Removes the first occurrence of the specified element from this list,
if it is present.
|
void |
removeOnListChangedCallback(ObservableList.OnListChangedCallback listener)
Removes a callback previously added.
|
protected void |
removeRange(int fromIndex,
int toIndex)
Removes from this list all of the elements whose index is between
fromIndex , inclusive, and toIndex , exclusive. |
T |
set(int index,
T object)
Replaces the element at the specified position in this list with
the specified element.
|
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeAll, removeIf, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeAll, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray
parallelStream, removeIf, stream
public void addOnListChangedCallback(ObservableList.OnListChangedCallback listener)
ObservableList
addOnListChangedCallback
in interface ObservableList<T>
listener
- The callback to be notified on list changespublic void removeOnListChangedCallback(ObservableList.OnListChangedCallback listener)
ObservableList
removeOnListChangedCallback
in interface ObservableList<T>
listener
- The callback to remove.public boolean add(T object)
ArrayList
add
in interface Collection<T>
add
in interface List<T>
add
in class ArrayList<T>
object
- element to be appended to this listCollection.add(E)
)public void add(int index, T object)
ArrayList
public boolean addAll(Collection<? extends T> collection)
ArrayList
addAll
in interface Collection<T>
addAll
in interface List<T>
addAll
in class ArrayList<T>
collection
- collection containing elements to be added to this listAbstractCollection.add(Object)
public boolean addAll(int index, Collection<? extends T> collection)
ArrayList
addAll
in interface List<T>
addAll
in class ArrayList<T>
index
- index at which to insert the first element from the
specified collectioncollection
- collection containing elements to be added to this listpublic void clear()
ArrayList
public T remove(int index)
ArrayList
public boolean remove(Object object)
ArrayList
public T set(int index, T object)
ArrayList
protected void removeRange(int fromIndex, int toIndex)
ArrayList
fromIndex
, inclusive, and toIndex
, exclusive.
Shifts any succeeding elements to the left (reduces their index).
This call shortens the list by (toIndex - fromIndex)
elements.
(If toIndex==fromIndex
, this operation has no effect.)removeRange
in class ArrayList<T>
fromIndex
- index of first element to be removedtoIndex
- index after last element to be removed