|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--org.argouml.model.uml.EventListenerList
A wrapped object array that contains triples of eventtype, eventname, interested listener. I used an Object array for this purpose since it performs fast. Copied a lot of the code from javax.swing.EventListenerList.
| Field Summary | |
|---|---|
(package private) java.lang.Object[] |
_listenerList
The list of EventKey - Listener pairs. |
private static java.lang.Object[] |
NULL_ARRAY
A null array to be shared by all empty listener lists |
| Constructor Summary | |
|---|---|
(package private) |
EventListenerList()
|
| Method Summary | |
|---|---|
void |
add(EventKey key,
MElementListener listener)
Registers the given listeners for the event typed by EventKey. |
int |
getListenerCount()
Returns the total number of listeners for this listener list. |
int |
getListenerCount(EventKey key)
Returns the total number of listeners of the supplied type for this listener list. |
private int |
getListenerCount(java.lang.Object[] list,
EventKey key)
Returns the number of listeners that are interested in the given key and exist in the given object array. |
MElementListener[] |
getListeners(EventKey key)
Returns an array of listeners that are interested in an event that is typed by the given EventKey. |
void |
remove(EventKey key,
MElementListener listener)
Removes a listener from the list. |
private void |
removeElement(int index)
Does the actual removal of an element at the given index in the list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final java.lang.Object[] NULL_ARRAY
java.lang.Object[] _listenerList
| Constructor Detail |
EventListenerList()
| Method Detail |
public MElementListener[] getListeners(EventKey key)
key -
public void add(EventKey key,
MElementListener listener)
A listener that has been added twice will get the events for which it registred twice. Be careful with registring listeners!
key - listener -
public void remove(EventKey key,
MElementListener listener)
key - listener - private void removeElement(int index)
index -
private int getListenerCount(java.lang.Object[] list,
EventKey key)
list - key -
public int getListenerCount(EventKey key)
public int getListenerCount()
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
| ArgoUML © 1996-2004 (20040306) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |