ca.odell.glazedlists
Interface EventList<E>

All Superinterfaces:
Collection<E>, Iterable<E>, List<E>
All Known Implementing Classes:
AbstractEventList, AbstractFilterList, BasicEventList, CachingList, CollectionList, CompositeList, FileList, FilterList, FreezableList, FunctionList, GroupingList, NetworkList, ObservableElementList, PopularityList, RangeList, SortedList, TextFilterList, ThresholdList, TransformedList, UniqueList

public interface EventList<E>
extends List<E>

An observable List. ListEventListeners can register to be notified when this list changes.

EventLists may be writable or read-only. Consult the Javadoc for your EventList if you are unsure.

Warning: EventLists 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: EventLists may break the contract required by 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.

Author:
Jesse Wilson
See Also:
GlazedLists.eventList(Collection), GlazedLists.readOnlyList(EventList), GlazedLists.threadSafeList(EventList), GlazedLists.weakReferenceProxy(EventList, ListEventListener)

Method Summary
 void addListEventListener(ListEventListener<E> listChangeListener)
          Registers the specified listener to receive change updates for this list.
 ListEventPublisher getPublisher()
          Get the publisher used to distribute ListEvents.
 ReadWriteLock getReadWriteLock()
          Gets the lock required to share this list between multiple threads.
 void removeListEventListener(ListEventListener<E> listChangeListener)
          Removes the specified listener from receiving change updates for this list.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Method Detail

addListEventListener

void addListEventListener(ListEventListener<E> listChangeListener)
Registers the specified listener to receive change updates for this list.


removeListEventListener

void removeListEventListener(ListEventListener<E> listChangeListener)
Removes the specified listener from receiving change updates for this list.


getReadWriteLock

ReadWriteLock getReadWriteLock()
Gets the lock required to share this list between multiple threads.

Returns:
a re-entrant ReadWriteLock that guarantees thread safe access to this list.

getPublisher

ListEventPublisher getPublisher()
Get the publisher used to distribute ListEvents.



Glazed Lists 1.5.0, Copyright © 2003-2005 publicobject.com, O'Dell Engineering.
Documentation build by James Lemieux at 2005-12-21 23:25