public class InterceptableEventList<E> extends AbstractEventList<E>
EventList
that allows write operations to it to be intercepted.Modifier and Type | Field and Description |
---|---|
protected EventListInterceptor<E> |
interceptor |
publisher, readWriteLock, updates
Constructor and Description |
---|
InterceptableEventList(EventList<E> delegate,
EventListInterceptor<E> interceptor) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
E element)
Inserts the specified element at the specified position in this list (optional operation).
|
boolean |
addAll(int index,
Collection<? extends E> c)
Inserts all of the elements in the specified collection into this list at the specified
position (optional operation).
|
void |
addListEventListener(ListEventListener<? super E> listChangeListener)
Registers the specified listener to receive change updates for this list.
|
void |
clear()
Removes all of the elements from this list (optional operation).
|
void |
dispose()
Disposing an EventList will make it eligible for garbage collection.
|
E |
get(int index)
Returns the element at the specified position in this list.
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this list in proper sequence.
|
ListIterator<E> |
listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the
specified position in this list.
|
E |
remove(int index)
Removes the element at the specified position in this list (optional operation).
|
boolean |
removeAll(Collection<?> c)
Removes from this list all the elements that are contained in the specified collection
(optional operation).
|
void |
removeListEventListener(ListEventListener<? super E> listChangeListener)
Removes the specified listener from receiving change updates for this list.
|
boolean |
retainAll(Collection<?> c)
Retains only the elements in this list that are contained in the specified collection (optional
operation).
|
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.
|
add, addAll, contains, containsAll, equals, getPublisher, getReadWriteLock, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, remove, subList, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
replaceAll, sort, spliterator
parallelStream, removeIf, stream
protected final EventListInterceptor<E> interceptor
public InterceptableEventList(EventList<E> delegate, EventListInterceptor<E> interceptor)
public void add(int index, E element)
AbstractEventList
public boolean addAll(int index, Collection<? extends E> c)
AbstractEventList
public void clear()
AbstractEventList
clear
in interface Collection<E>
clear
in interface List<E>
clear
in class AbstractEventList<E>
public void dispose()
EventList
Warning: It is an error to call any method on an EventList
after it has been disposed.
public E get(int index)
AbstractEventList
public Iterator<E> iterator()
AbstractEventList
The returned Iterator
will become inconsistent if the EventList
that it views
is modified. To overcome this problem, use AbstractEventList.listIterator()
. When used concurrently, the
returned Iterator
requires locking via this list's ReadWriteLock
.
public ListIterator<E> listIterator(int index)
AbstractEventList
next
method. An initial call to the
previous
method would return the element with the specified index minus one.
Unlike the ListIterator
from a regular List
, the EventList
's
ListIterator
will remain consistent even if the EventList
is changed
externally. Note that when used concurrently, the returned ListIterator
requires
locking via this list's ReadWriteLock
.
listIterator
in interface List<E>
listIterator
in class AbstractEventList<E>
index
- index of first element to be returned from the list iterator (by a call to the
next
method).public E remove(int index)
AbstractEventList
public boolean removeAll(Collection<?> c)
AbstractEventList
removeAll
in interface Collection<E>
removeAll
in interface List<E>
removeAll
in class AbstractEventList<E>
c
- collection that defines which elements will be removed from this list.true
if this list changed as a result of the call.AbstractEventList.remove(Object)
,
AbstractEventList.contains(Object)
public boolean retainAll(Collection<?> c)
AbstractEventList
retainAll
in interface Collection<E>
retainAll
in interface List<E>
retainAll
in class AbstractEventList<E>
c
- collection that defines which elements this set will retain.true
if this list changed as a result of the call.AbstractEventList.remove(Object)
,
AbstractEventList.contains(Object)
public E set(int index, E element)
AbstractEventList
public int size()
AbstractEventList
Integer.MAX_VALUE
elements, returns Integer.MAX_VALUE
.size
in interface Collection<E>
size
in interface List<E>
size
in class AbstractEventList<E>
public void addListEventListener(ListEventListener<? super E> listChangeListener)
AbstractEventList
addListEventListener
in interface EventList<E>
addListEventListener
in class AbstractEventList<E>
listChangeListener
- event listener != nullpublic void removeListEventListener(ListEventListener<? super E> listChangeListener)
AbstractEventList
removeListEventListener
in interface EventList<E>
removeListEventListener
in class AbstractEventList<E>
listChangeListener
- event listener != nullCopyright © 2024 levigo holding gmbh. All rights reserved.