public final class BasicEventList<E> extends AbstractEventList<E> implements java.io.Serializable, java.util.RandomAccess
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 |
publisher, readWriteLock, updates| Constructor and Description |
|---|
BasicEventList()
Creates a
BasicEventList. |
BasicEventList(int initalCapacity)
Creates an empty
BasicEventList with the given
initialCapacity. |
BasicEventList(int initialCapacity,
ListEventPublisher publisher,
ReadWriteLock readWriteLock)
Creates a
BasicEventList using the specified initial capacity,
ListEventPublisher and ReadWriteLock. |
BasicEventList(java.util.List<E> 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). |
BasicEventList(ListEventPublisher publisher,
ReadWriteLock readWriteLock)
|
BasicEventList(ReadWriteLock readWriteLock)
Creates a
BasicEventList that uses the specified ReadWriteLock
for concurrent access. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E element)
Appends the specified element to the end of this list (optional
operation).
|
void |
add(int index,
E element)
Inserts the specified element at the specified position in this list
(optional operation).
|
boolean |
addAll(java.util.Collection<? extends E> collection)
Appends all of the elements in the specified collection to the end of
this list, in the order that they are returned by the specified
collection's iterator (optional operation).
|
boolean |
addAll(int index,
java.util.Collection<? extends E> collection)
Inserts all of the elements in the specified collection into this
list at the specified position (optional operation).
|
void |
clear()
Removes all of the elements from this list (optional operation).
|
void |
dispose()
This method does nothing.
|
void |
forEach(java.util.function.Consumer<? super E> action) |
E |
get(int index)
Returns the element at the specified position in this list.
|
java.util.stream.Stream<E> |
parallelStream() |
E |
remove(int index)
Removes the element at the specified position in this list (optional
operation).
|
boolean |
remove(java.lang.Object element)
Removes the first occurrence in this list of the specified element
(optional operation).
|
boolean |
removeIf(java.util.function.Predicate<? super E> filter)
Removes all of the elements of this collection that satisfy the given
predicate.
|
void |
replaceAll(java.util.function.UnaryOperator<E> operator) |
E |
set(int index,
E element)
Replaces the element at the specified position in this list with the
specified element (optional operation).
|
int |
size()
Returns the number of elements in this list.
|
java.util.Spliterator<E> |
spliterator() |
java.util.stream.Stream<E> |
stream() |
addListEventListener, contains, containsAll, equals, getPublisher, getReadWriteLock, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeAll, removeListEventListener, retainAll, subList, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitacceptWithReadLock, acceptWithWriteLock, applyWithReadLock, applyWithWriteLockpublic BasicEventList()
BasicEventList.public BasicEventList(ReadWriteLock readWriteLock)
BasicEventList that uses the specified ReadWriteLock
for concurrent access.public BasicEventList(int initalCapacity)
BasicEventList with the given
initialCapacity.public BasicEventList(ListEventPublisher publisher, ReadWriteLock readWriteLock)
public BasicEventList(int initialCapacity,
ListEventPublisher publisher,
ReadWriteLock readWriteLock)
BasicEventList using the specified initial capacity,
ListEventPublisher and ReadWriteLock.@Deprecated public BasicEventList(java.util.List<E> list)
GlazedLists.eventList(Collection).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.
public void add(int index,
E element)
add in interface java.util.List<E>add in class AbstractEventList<E>index - index at which the specified element is to be inserted.element - element to be inserted.public boolean add(E element)
Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.
add in interface java.util.Collection<E>add in interface java.util.List<E>add in class AbstractEventList<E>element - element to be appended to this list.public boolean addAll(java.util.Collection<? extends E> collection)
addAll in interface java.util.Collection<E>addAll in interface java.util.List<E>addAll in class AbstractEventList<E>collection - collection whose elements are to be added to this list.AbstractEventList.add(Object)public boolean addAll(int index,
java.util.Collection<? extends E> collection)
addAll in interface java.util.List<E>addAll in class AbstractEventList<E>index - index at which to insert first element from the specified
collection.collection - elements to be inserted into this list.public E remove(int index)
remove in interface java.util.List<E>remove in class AbstractEventList<E>index - the index of the element to removed.public boolean remove(java.lang.Object element)
remove in interface java.util.Collection<E>remove in interface java.util.List<E>remove in class AbstractEventList<E>element - element to be removed from this list, if present.public void clear()
clear in interface java.util.Collection<E>clear in interface java.util.List<E>clear in class AbstractEventList<E>public E set(int index, E element)
set in interface java.util.List<E>set in class AbstractEventList<E>index - index of element to replace.element - element to be stored at the specified position.public E get(int index)
get in interface java.util.List<E>get in class AbstractEventList<E>index - index of element to return.public int size()
size in interface java.util.Collection<E>size in interface java.util.List<E>size in class AbstractEventList<E>public boolean removeIf(java.util.function.Predicate<? super E> filter)
removeIf in interface java.util.Collection<E>removeIf in class AbstractEventList<E>filter - a predicate which returns true for elements to be
removedtrue if any elements were removedpublic void replaceAll(java.util.function.UnaryOperator<E> operator)
replaceAll in interface java.util.List<E>replaceAll in class AbstractEventList<E>public void forEach(java.util.function.Consumer<? super E> action)
forEach in interface java.lang.Iterable<E>public java.util.stream.Stream<E> stream()
stream in interface java.util.Collection<E>public java.util.stream.Stream<E> parallelStream()
parallelStream in interface java.util.Collection<E>public java.util.Spliterator<E> spliterator()
Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by swimmesberger at Wed Feb 13 09:45:20 CET 2019