T - the type of objects contained within this collectionpublic class ArrayListWithCallbacks<T>
extends java.util.ArrayList<T>
Collection is modified.| Modifier and Type | Class and Description |
|---|---|
static interface |
ArrayListWithCallbacks.OnItemAddedListener
Interface definition for callbacks to be invoked whenever an item is added to an
ArrayListWithCallbacks. |
static interface |
ArrayListWithCallbacks.OnItemRemovedListener
Interface definition for callbacks to be received whenever an item is removed from an
ArrayListWithCallbacks. |
static interface |
ArrayListWithCallbacks.OnListChangedListener
Interface definition for callbacks to be received whenever an
ArrayListWithCallbacks
is modified. |
static interface |
ArrayListWithCallbacks.OnListClearedListener
Interface definition for callbacks to be received whenever an
ArrayListWithCallbacks
is cleared. |
| Constructor and Description |
|---|
ArrayListWithCallbacks()
Constructs a new instance of
ArrayListWithCallbacks. |
ArrayListWithCallbacks(java.util.Collection<T> collection)
Constructs a new instance of
ArrayListWithCallbacks containing the elements of the
specified collection. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T object) |
boolean |
add(T object) |
boolean |
addAll(java.util.Collection<? extends T> collection) |
boolean |
addAll(int index,
java.util.Collection<? extends T> collection) |
void |
addOnItemAddedListener(ArrayListWithCallbacks.OnItemAddedListener listener)
Adds an
OnItemAddedListener to this ArrayListWithCallbacks. |
void |
addOnItemRemovedListener(ArrayListWithCallbacks.OnItemRemovedListener listener)
Adds an
OnItemRemovedListener to this ArrayListWithCallbacks. |
void |
addOnListChangedListener(ArrayListWithCallbacks.OnListChangedListener listener)
Adds an
OnListChangedListener to this ArrayListWithCallbacks. |
void |
addOnListClearedListener(ArrayListWithCallbacks.OnListClearedListener listener)
Adds an
OnListClearedListener to this ArrayListWithCallbacks. |
void |
clear() |
T |
remove(int index) |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> collection) |
void |
removeOnItemAddedListener(ArrayListWithCallbacks.OnItemAddedListener listener)
Removes an
OnItemAddedListener from this ArrayListWithCallbacks. |
void |
removeOnItemRemovedListener(ArrayListWithCallbacks.OnItemRemovedListener listener)
Removes an
OnItemRemovedListener from this ArrayListWithCallbacks. |
void |
removeOnListChangedListener(ArrayListWithCallbacks.OnListChangedListener listener)
Removed an
OnListChangedListener from this ArrayListWithCallbacks. |
void |
removeOnListClearedListener(ArrayListWithCallbacks.OnListClearedListener listener)
Removes an
OnListClearedListener from this ArrayListWithCallbacks. |
boolean |
retainAll(java.util.Collection<?> collection) |
T |
set(int index,
T object) |
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeIf, removeRange, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSizepublic ArrayListWithCallbacks()
ArrayListWithCallbacks.public ArrayListWithCallbacks(java.util.Collection<T> collection)
ArrayListWithCallbacks containing the elements of the
specified collection. This method will not invoke callbacks.collection - the collection of elements to addpublic boolean add(T object)
public void add(int index,
T object)
public boolean addAll(java.util.Collection<? extends T> collection)
public boolean addAll(int index,
java.util.Collection<? extends T> collection)
public T remove(int index)
public boolean remove(java.lang.Object object)
public boolean removeAll(java.util.Collection<?> collection)
public void clear()
public boolean retainAll(java.util.Collection<?> collection)
public void addOnItemAddedListener(ArrayListWithCallbacks.OnItemAddedListener listener)
OnItemAddedListener to this ArrayListWithCallbacks. This method has
no effect if null is supplied, or if the listener is already registered.listener - the listener to addpublic void addOnItemRemovedListener(ArrayListWithCallbacks.OnItemRemovedListener listener)
OnItemRemovedListener to this ArrayListWithCallbacks. This method
has no effect if null is supplied, or if the listener is already registered.listener - the listener to addpublic void addOnListClearedListener(ArrayListWithCallbacks.OnListClearedListener listener)
OnListClearedListener to this ArrayListWithCallbacks. This method
has no effect if null is supplied or if the listener is already registered.listener - the listener to addpublic void addOnListChangedListener(ArrayListWithCallbacks.OnListChangedListener listener)
OnListChangedListener to this ArrayListWithCallbacks. this method
has no effect if null is supplied or if the listener is already registered.listener - the listener to addpublic void removeOnItemAddedListener(ArrayListWithCallbacks.OnItemAddedListener listener)
OnItemAddedListener from this ArrayListWithCallbacks. This method
has no effect if null is supplied, or if the listener is not registered.listener - the listener to removepublic void removeOnItemRemovedListener(ArrayListWithCallbacks.OnItemRemovedListener listener)
OnItemRemovedListener from this ArrayListWithCallbacks. This
method has no effect if null is supplied or if the listener is not registered.listener - the listener to removepublic void removeOnListClearedListener(ArrayListWithCallbacks.OnListClearedListener listener)
OnListClearedListener from this ArrayListWithCallbacks. This
method has no effect if null is supplied or if the listener is not registered.listener - the listener to removepublic void removeOnListChangedListener(ArrayListWithCallbacks.OnListChangedListener listener)
OnListChangedListener from this ArrayListWithCallbacks. This
method has no effect if null is supplied or if the listener is not registered.listener - the listener to remove