E
- the type of the collection.public class ObservableCollection<E> extends ArrayList<E>
ArrayList
which
can notify listeners about changes in the collection. For example when
items are added, removed, replaced etc.Constructor and Description |
---|
ObservableCollection() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E item) |
void |
add(int index,
E item) |
boolean |
addAll(Collection<? extends E> collection) |
boolean |
addAll(int index,
Collection<? extends E> collection) |
void |
addCollectionChangeListener(CollectionChangeListener<E> listener)
Adds a new listener to the collection of change listeners that will be notified when a change
in the collection occurs using the
notifyListeners(CollectionChangedEvent) method. |
void |
beginUpdate() |
void |
clear() |
void |
endUpdate() |
E |
remove(int index) |
boolean |
remove(Object item) |
boolean |
removeAll(Collection<?> collection) |
void |
removeCollectionChangeListener(CollectionChangeListener<E> listener)
Removes a specific change listener from the listeners collection.
|
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
containsAll, equals, hashCode
parallelStream, stream
public void beginUpdate()
public void endUpdate()
public void addCollectionChangeListener(CollectionChangeListener<E> listener)
notifyListeners(CollectionChangedEvent)
method.listener
- the new listener to be added.public void removeCollectionChangeListener(CollectionChangeListener<E> listener)
listener
- the listener to be removed.public boolean add(E item)
public void add(int index, E item)
public boolean remove(Object item)
public E remove(int index)
public void clear()
public boolean addAll(Collection<? extends E> collection)
public boolean addAll(int index, Collection<? extends E> collection)
public boolean removeAll(Collection<?> collection)