org.apache.batik.dom.events

Class EventListenerList

public class EventListenerList extends Object

Class to manager event listeners for one event type.
Nested Class Summary
classEventListenerList.Entry
EventListenerTable entry class.
Field Summary
protected IntTablecounts
Counts of listener entries with a given namespace URI.
protected EventListenerList.Entryhead
Linked list of entries.
protected EventListenerList.Entry[]listeners
Cache of listeners with any namespace URI.
protected HashTablelistenersNS
Caches of listeners with a given namespace URI.
protected intn
Total number of event listners.
Method Summary
voidaddListener(String namespaceURI, Object group, EventListener listener)
Adds a listener.
EventListenerList.Entry[]getEventListeners()
Returns an array containing all event listener entries.
EventListenerList.Entry[]getEventListeners(String namespaceURI)
Returns an array of EventListeners that match the given namespace URI.
booleanhasEventListener(String namespaceURI)
Returns whether there is an event listener for the given namespace URI.
voidremoveListener(String namespaceURI, EventListener listener)
Removes a listener.
intsize()
Returns the number of event listeners stored in this object.

Field Detail

counts

protected IntTable counts
Counts of listener entries with a given namespace URI.

head

protected EventListenerList.Entry head
Linked list of entries.

listeners

protected EventListenerList.Entry[] listeners
Cache of listeners with any namespace URI.

listenersNS

protected HashTable listenersNS
Caches of listeners with a given namespace URI.

n

protected int n
Total number of event listners.

Method Detail

addListener

public void addListener(String namespaceURI, Object group, EventListener listener)
Adds a listener.

getEventListeners

public EventListenerList.Entry[] getEventListeners()
Returns an array containing all event listener entries.

getEventListeners

public EventListenerList.Entry[] getEventListeners(String namespaceURI)
Returns an array of EventListeners that match the given namespace URI.

hasEventListener

public boolean hasEventListener(String namespaceURI)
Returns whether there is an event listener for the given namespace URI.

removeListener

public void removeListener(String namespaceURI, EventListener listener)
Removes a listener.

size

public int size()
Returns the number of event listeners stored in this object.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.