vitro.util
Class ObservableList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
vitro.util.ObservableList<E>
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, List<E>, ObservableCollection<E>
public class ObservableList<E>
- extends AbstractList<E>
- implements ObservableCollection<E>
An ObservableCollection implementing the List
interface by way of extending AbstractList and
wrapping an internal List.
Methods inherited from class java.util.AbstractList |
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList |
ObservableList
public ObservableList()
- Create a new, empty List.
ObservableList
public ObservableList(Collection<? extends E> c)
- Create a new List with the same elements as another Collection.
- Parameters:
c
- the source Collection.
ObservableList
public ObservableList(Collection<? extends E> c,
ObservableCollection host)
- Create a new List with the same elements as another Collection.
Update notifications will be sent to observers as if originating
at the supplied host ObservableCollection.
- Parameters:
c
- the source Collection.host
- the host ObservableCollection
addObserver
public void addObserver(CollectionObserver<E> o)
- Description copied from interface:
ObservableCollection
- Register a CollectionObserver with this Collection.
The callbacks provided in the CollectionObserver
interface will be fired whenever elements are added
to or removed from this Collection.
- Specified by:
addObserver
in interface ObservableCollection<E>
- Parameters:
o
- the CollectionObserver to register.
store
public List<E> store()
- Obtain a reference to the backing store used by this List.
Changes to the backing store will not trigger calls
to any observers of this collection.
- Returns:
- the internal List.
get
public E get(int i)
- Specified by:
get
in interface List<E>
- Specified by:
get
in class AbstractList<E>
size
public int size()
- Specified by:
size
in interface Collection<E>
- Specified by:
size
in interface List<E>
- Specified by:
size
in class AbstractCollection<E>
remove
public E remove(int i)
- Specified by:
remove
in interface List<E>
- Overrides:
remove
in class AbstractList<E>
add
public void add(int i,
E e)
- Specified by:
add
in interface List<E>
- Overrides:
add
in class AbstractList<E>
set
public E set(int i,
E e)
- Specified by:
set
in interface List<E>
- Overrides:
set
in class AbstractList<E>