|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 | |
private Object[] |
listenerList
The list of EventKey - Listener pairs. |
private static Logger |
LOG
|
private static 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,
ru.novosoft.uml.MElementListener listener)
Registers the given listeners for the event typed by EventKey. |
boolean |
contains(EventKey key,
ru.novosoft.uml.MElementListener listener)
|
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(Object[] list,
EventKey key)
Returns the number of listeners that are interested in the given key and exist in the given object array. |
(package private) Object[] |
getListenerList()
|
ru.novosoft.uml.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,
ru.novosoft.uml.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. |
(package private) void |
setListenerList(Object[] ll)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final Logger LOG
private static final Object[] NULL_ARRAY
private Object[] listenerList
Constructor Detail |
EventListenerList()
Method Detail |
public ru.novosoft.uml.MElementListener[] getListeners(EventKey key)
key
-
public void add(EventKey key, ru.novosoft.uml.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 boolean contains(EventKey key, ru.novosoft.uml.MElementListener listener)
public void remove(EventKey key, ru.novosoft.uml.MElementListener listener)
key
- listener
- private void removeElement(int index)
index
- private int getListenerCount(Object[] list, EventKey key)
list
- key
-
public int getListenerCount(EventKey key)
key
- The type.
public int getListenerCount()
void setListenerList(Object[] ll)
ll
- The listenerList to set.Object[] getListenerList()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |