|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.concurrent.CopyOnWriteArrayList<E> com.bbn.openmap.event.ListenerSupport<E>
public class ListenerSupport<E>
This is an utility class that can be used by beans that need support for handling listeners and firing events. You can use an subclass of this class as a member field of your bean and delegate work to it. It handles the work for a listener support subclass managing the Vector of listeners. It knows nothing about firing events to the listeners.
Field Summary | |
---|---|
protected java.lang.Object |
source
|
Constructor Summary | |
---|---|
ListenerSupport(java.lang.Object sourceBean)
Construct a ListenerSupport object. |
Method Summary | |
---|---|
boolean |
add(E o)
Wrapper functions to make the iterator methods' synchronization work. |
void |
add(int i,
E o)
|
boolean |
addAll(int index,
java.util.Collection<? extends E> c)
|
void |
clear()
|
protected java.lang.Object |
getSource()
Get the source of the events. |
java.util.Iterator<E> |
iterator()
Return an iterator over a clone of the listeners. |
java.util.ListIterator<E> |
listIterator()
Return an ListIterator over a clone of the listeners, initialized to the end of the list. |
E |
remove(int index)
|
boolean |
remove(java.lang.Object o)
|
E |
set(int index,
E element)
|
protected void |
setSource(java.lang.Object src)
Set the source of the events. |
int |
size()
|
Methods inherited from class java.util.concurrent.CopyOnWriteArrayList |
---|
addAll, addAllAbsent, addIfAbsent, clone, contains, containsAll, equals, get, hashCode, indexOf, indexOf, isEmpty, lastIndexOf, lastIndexOf, listIterator, removeAll, retainAll, subList, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object source
Constructor Detail |
---|
public ListenerSupport(java.lang.Object sourceBean)
sourceBean
- The bean to be given as the source for any events.Method Detail |
---|
protected void setSource(java.lang.Object src)
protected java.lang.Object getSource()
public java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in interface java.util.List<E>
iterator
in class java.util.concurrent.CopyOnWriteArrayList<E>
public java.util.ListIterator<E> listIterator()
listIterator
in interface java.util.List<E>
listIterator
in class java.util.concurrent.CopyOnWriteArrayList<E>
public boolean add(E o)
add
in interface java.util.Collection<E>
add
in interface java.util.List<E>
add
in class java.util.concurrent.CopyOnWriteArrayList<E>
public void add(int i, E o)
add
in interface java.util.List<E>
add
in class java.util.concurrent.CopyOnWriteArrayList<E>
public boolean addAll(int index, java.util.Collection<? extends E> c)
addAll
in interface java.util.List<E>
addAll
in class java.util.concurrent.CopyOnWriteArrayList<E>
public void clear()
clear
in interface java.util.Collection<E>
clear
in interface java.util.List<E>
clear
in class java.util.concurrent.CopyOnWriteArrayList<E>
public E remove(int index)
remove
in interface java.util.List<E>
remove
in class java.util.concurrent.CopyOnWriteArrayList<E>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<E>
remove
in interface java.util.List<E>
remove
in class java.util.concurrent.CopyOnWriteArrayList<E>
public E set(int index, E element)
set
in interface java.util.List<E>
set
in class java.util.concurrent.CopyOnWriteArrayList<E>
public int size()
size
in interface java.util.Collection<E>
size
in interface java.util.List<E>
size
in class java.util.concurrent.CopyOnWriteArrayList<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |