E
- Type of itemspublic class ObservableCollection<E>
extends java.util.ArrayList<E>
List
implementation which allows to get notification about adding, removing items from itConstructor and Description |
---|
ObservableCollection()
Creates a new
ObservableCollection instance |
ObservableCollection(java.util.Collection<? extends E> collection)
Creates a new
ObservableCollection instance which contains the elements of
the specified collection. |
ObservableCollection(int capacity)
Creates a new
ObservableCollection instance |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E object) |
void |
add(int location,
E object) |
boolean |
addAll(java.util.Collection<? extends E> collection) |
boolean |
addAll(int location,
java.util.Collection<? extends E> collection) |
void |
addObserver(ICollectionObserver<E> observer)
Adds the
ICollectionObserver instance into the list to notify if this collection changes |
void |
clear() |
E |
remove(int location) |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> collection) |
void |
removeObserver(ICollectionObserver<E> observer)
Removes the
ICollectionObserver instance from the list to notify if this collection changes |
protected void |
removeRange(int fromIndex,
int toIndex) |
boolean |
retainAll(java.util.Collection<?> collection) |
E |
set(int location,
E object) |
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeIf, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
public ObservableCollection(int capacity)
ObservableCollection
instancecapacity
- The initial capacitypublic ObservableCollection()
ObservableCollection
instancepublic ObservableCollection(java.util.Collection<? extends E> collection)
ObservableCollection
instance which contains the elements of
the specified collection.collection
- The collection with items to addpublic void add(int location, E object)
public boolean add(E object)
public boolean addAll(int location, @NonNull java.util.Collection<? extends E> collection)
public boolean addAll(@NonNull java.util.Collection<? extends E> collection)
public E remove(int location)
public boolean removeAll(java.util.Collection<?> collection)
public boolean retainAll(java.util.Collection<?> collection)
protected void removeRange(int fromIndex, int toIndex)
removeRange
in class java.util.ArrayList<E>
public boolean remove(java.lang.Object object)
public void clear()
public final void addObserver(ICollectionObserver<E> observer)
ICollectionObserver
instance into the list to notify if this collection changesobserver
- The observer to addpublic final void removeObserver(ICollectionObserver<E> observer)
ICollectionObserver
instance from the list to notify if this collection changesobserver
- The observer to remove