com.bbn.openmap.event
Class ListenerSupport<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
com.bbn.openmap.event.ListenerSupport<E>
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.RandomAccess
- Direct Known Subclasses:
- CenterSupport, EOMGListenerSupport, LayerSupport, MapMouseSupport, OverviewMapHandler.ControlledMapSupport, PaintListenerSupport, PanSupport, ProgressSupport, ProjectionSupport, SymbolChooser.SymbolTreeHolder, WindowSupport, ZoomSupport
public class ListenerSupport<E>
- extends java.util.ArrayList<E>
- implements java.io.Serializable
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.
- See Also:
- Serialized Form
|
Field Summary |
protected java.lang.Object |
source
|
| Fields inherited from class java.util.AbstractList |
modCount |
|
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.ArrayList |
addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, removeRange, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
equals, hashCode, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
containsAll, equals, hashCode, listIterator, removeAll, retainAll, subList |
source
protected java.lang.Object source
ListenerSupport
public ListenerSupport(java.lang.Object sourceBean)
- Construct a ListenerSupport object.
- Parameters:
sourceBean - The bean to be given as the source for any events.
setSource
protected void setSource(java.lang.Object src)
- Set the source of the events.
getSource
protected java.lang.Object getSource()
- Get the source of the events.
iterator
public java.util.Iterator<E> iterator()
- Return an iterator over a clone of the listeners.
- Specified by:
iterator in interface java.lang.Iterable<E>- Specified by:
iterator in interface java.util.Collection<E>- Specified by:
iterator in interface java.util.List<E>- Overrides:
iterator in class java.util.AbstractList<E>
listIterator
public java.util.ListIterator<E> listIterator()
- Return an ListIterator over a clone of the listeners, initialized to the
end of the list.
- Specified by:
listIterator in interface java.util.List<E>- Overrides:
listIterator in class java.util.AbstractList<E>
add
public boolean add(E o)
- Wrapper functions to make the iterator methods' synchronization work.
- Specified by:
add in interface java.util.Collection<E>- Specified by:
add in interface java.util.List<E>- Overrides:
add in class java.util.ArrayList<E>
add
public void add(int i,
E o)
- Specified by:
add in interface java.util.List<E>- Overrides:
add in class java.util.ArrayList<E>
addAll
public boolean addAll(int index,
java.util.Collection<? extends E> c)
- Specified by:
addAll in interface java.util.List<E>- Overrides:
addAll in class java.util.ArrayList<E>
clear
public void clear()
- Specified by:
clear in interface java.util.Collection<E>- Specified by:
clear in interface java.util.List<E>- Overrides:
clear in class java.util.ArrayList<E>
remove
public E remove(int index)
- Specified by:
remove in interface java.util.List<E>- Overrides:
remove in class java.util.ArrayList<E>
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove in interface java.util.Collection<E>- Specified by:
remove in interface java.util.List<E>- Overrides:
remove in class java.util.ArrayList<E>
set
public E set(int index,
E element)
- Specified by:
set in interface java.util.List<E>- Overrides:
set in class java.util.ArrayList<E>
size
public int size()
- Specified by:
size in interface java.util.Collection<E>- Specified by:
size in interface java.util.List<E>- Overrides:
size in class java.util.ArrayList<E>
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details