java.lang.Object | ||
↳ | sofia.util.Observable | |
↳ | sofia.util.ObservableList<E> |
An implementation of the List interface that is Observable and notifies its observers whenever the collection is changed.
Users of this class can add themselves as observers to an instance of this class and they will be notified when the structure of the list changes; that is, when items are added, removed, or replaced.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ObservableList()
Creates a new
ObservableList that is backed by an
ArrayList with default capacity. | |||||||||||
ObservableList(int capacity)
Creates a new
ObservableList that is backed by an
ArrayList with the specified capacity. | |||||||||||
ObservableList(List<E> listToWrap)
Creates a new
ObservableList that provides an observable view of
an existing list. | |||||||||||
ObservableList(Collection<? extends E> collection)
Creates a new
ObservableList that is initialized with a copy of
the data in the specified collection. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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 | clear() | ||||||||||
boolean | contains(Object object) | ||||||||||
boolean | containsAll(Collection<?> collection) | ||||||||||
E | get(int index) | ||||||||||
int | indexOf(Object object) | ||||||||||
boolean | isEmpty() | ||||||||||
Iterator<E> | iterator() | ||||||||||
int | lastIndexOf(Object object) | ||||||||||
ListIterator<E> | listIterator(int index) | ||||||||||
ListIterator<E> | listIterator() | ||||||||||
E | remove(int index) | ||||||||||
boolean | remove(Object object) | ||||||||||
boolean | removeAll(Collection<?> collection) | ||||||||||
boolean | retainAll(Collection<?> collection) | ||||||||||
E | set(int index, E item) | ||||||||||
int | size() | ||||||||||
List<E> | subList(int start, int end) | ||||||||||
<T> T[] | toArray(T[] array) | ||||||||||
Object[] | toArray() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
sofia.util.Observable
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Iterable
| |||||||||||
From interface
java.util.Collection
| |||||||||||
From interface
java.util.List
|
Creates a new ObservableList
that is backed by an
ArrayList
with default capacity.
Creates a new ObservableList
that is backed by an
ArrayList
with the specified capacity.
capacity | the capacity of the array list |
---|
Creates a new ObservableList
that provides an observable view of
an existing list. The list passed to this constructor is not
copied; changes made to the observable list will also be reflected in
the list being wrapped, and vice versa.
listToWrap | the list to wrap with an observable front-end |
---|
Creates a new ObservableList
that is initialized with a copy of
the data in the specified collection. Since this constructor creates a
copy, changes to the observable list will not be reflected in
the source collection, and vice versa.
collection | the collection to be copied into the new list |
---|