ca.odell.glazedlists

Class BasicEventList<E>

Implemented Interfaces:
List, Serializable, EventList<E>

public final class BasicEventList<E>
extends AbstractEventList<E>
implements Serializable

An EventList that wraps any simple List, such as ArrayList or LinkedList.

Unlike most EventLists, this class is Serializable. When BasicEventList is serialized, all of its elements are serialized and all of its listeners that implement Serializable. Upon deserialization, the new copy uses a different lock than its source BasicEventList.

EventList Overview
Writable:yes
Concurrency:thread ready, not thread safe
Performance:reads: O(1), writes O(1) amortized
Memory:O(N)
Unit Tests:N/A
Issues:N/A
Author:
Jesse Wilson

Field Summary

Fields inherited from class ca.odell.glazedlists.AbstractEventList<E>

publisher, readWriteLock, updates

Constructor Summary

BasicEventList()
Creates a BasicEventList.
BasicEventList(List list)
Deprecated. As of 2005/03/06, this constructor has been declared unsafe because the source list is exposed.
BasicEventList(ListEventPublisher publisher, ReadWriteLock readWriteLock)
Creates a BasicEventList using the specified ListEventPublisher and ReadWriteLock.
BasicEventList(ReadWriteLock readWriteLock)
Creates a BasicEventList that uses the specified ReadWriteLock for concurrent access.
BasicEventList(int initalCapacity)
Creates an empty BasicEventList with the given initialCapacity.

Method Summary

boolean
add(E element)
void
add(int index, E element)
boolean
addAll(E> collection)
boolean
addAll(int index, E> collection)
void
clear()
E
get(int index)
boolean
remove(Object element)
E
remove(int index)
boolean
removeAll(Collection collection)
boolean
retainAll(Collection collection)
E
set(int index, E element)
int
size()

Methods inherited from class ca.odell.glazedlists.AbstractEventList<E>

T[] toArray, add, add, addAll, addAll, addListEventListener, clear, contains, containsAll, equals, get, getPublisher, getReadWriteLock, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeListEventListener, retainAll, set, size, subList, toArray, toString

Constructor Details

BasicEventList

public BasicEventList()

BasicEventList

public BasicEventList(List list)

Deprecated. As of 2005/03/06, this constructor has been declared unsafe because the source list is exposed. This allows it to be modified without the required events being fired. This constructor has been replaced by the factory method GlazedLists.eventList(Collection).

Creates a BasicEventList that uses the specified List as the underlying implementation.

Warning: all editing to the specified List must be done through via this BasicEventList interface. Otherwise this BasicEventList will become out of sync and operations will fail.


BasicEventList

public BasicEventList(ListEventPublisher publisher,
                      ReadWriteLock readWriteLock)
Creates a BasicEventList using the specified ListEventPublisher and ReadWriteLock.
Since:
2006-June-12

BasicEventList

public BasicEventList(ReadWriteLock readWriteLock)
Creates a BasicEventList that uses the specified ReadWriteLock for concurrent access.

BasicEventList

public BasicEventList(int initalCapacity)
Creates an empty BasicEventList with the given initialCapacity.

Method Details

add

public boolean add(E element)
Overrides:
add in interface AbstractEventList<E>

add

public void add(int index,
                E element)
Overrides:
add in interface AbstractEventList<E>

addAll

public boolean addAll(E> collection)
Overrides:
addAll in interface AbstractEventList<E>

addAll

public boolean addAll(int index,
                      E> collection)
Overrides:
addAll in interface AbstractEventList<E>

clear

public void clear()
Overrides:
clear in interface AbstractEventList<E>

get

public E get(int index)
Overrides:
get in interface AbstractEventList<E>

remove

public boolean remove(Object element)
Overrides:
remove in interface AbstractEventList<E>

remove

public E remove(int index)
Overrides:
remove in interface AbstractEventList<E>

removeAll

public boolean removeAll(Collection collection)
Overrides:
removeAll in interface AbstractEventList<E>

retainAll

public boolean retainAll(Collection collection)
Overrides:
retainAll in interface AbstractEventList<E>

set

public E set(int index,
             E element)
Overrides:
set in interface AbstractEventList<E>

size

public int size()
Overrides:
size in interface AbstractEventList<E>

Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by buildd at 2008-01-04 14:38