ca.odell.glazedlists
Interface EventList<E>
- List
- AbstractEventList<E>, BasicEventList<E>, CachingList, CollectionList<S,E>, CompositeList<E>, DebugList<E>, FileList, FilterList<E>, FreezableList<E>, FunctionList<S,E>, GroupingList<E>, NetworkList, ObservableElementList<E>, PopularityList<E>, RangeList<E>, SeparatorList<E>, SequenceList<E>, SortedList<E>, ThresholdList<E>, TransformedList<S,E>, UniqueList<E>
public interface EventList<E>
extends List
An observable
List
.
ListEventListener
s can register to be
notified when this list changes.
EventList
s may be writable or read-only. Consult the Javadoc for
your
EventList
if you are unsure.
Warning: EventList
s
are thread ready but not thread safe. If you are sharing an
EventList
between multiple threads, you can add thread safety by using the built-in
locks:
EventList myList = ...
myList.getReadWriteLock().writeLock().lock();
try {
// access myList here
if(myList.size() > 3) {
System.out.println(myList.get(3));
myList.remove(3);
}
} finally {
myList.getReadWriteLock().writeLock().unlock();
}
Warning: EventList
s
may break the contract required by
java.util.List
. For example, when
you
add()
on a
SortedList
, it will ignore the specified
index so that the element will be inserted in sorted order.
GlazedLists.eventList(Collection)
, GlazedLists.readOnlyList(EventList)
, GlazedLists.threadSafeList(EventList)
, GlazedLists.weakReferenceProxy(EventList, ListEventListener)
addListEventListener
public void addListEventListener(ListEventListener listChangeListener)
Registers the specified listener to receive change updates for this list.
getReadWriteLock
public ReadWriteLock getReadWriteLock()
Gets the lock required to share this list between multiple threads.
- a re-entrant
ReadWriteLock
that guarantees thread safe
access to this list.
removeListEventListener
public void removeListEventListener(ListEventListener listChangeListener)
Removes the specified listener from receiving change updates for this list.
Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by buildd at 2008-01-04 14:38