org.eclipse.wst.jsdt.launching

## Class ListenerList

- java.lang.Object
- - org.eclipse.wst.jsdt.launching.ListenerList

    public class ListenerList
    extends java.lang.Object

Local version of org.eclipse.jface.util.ListenerList (modified)s Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

### Constructor Summary

Constructors
Constructor and Description
`ListenerList(int capacity)` Creates a listener list with the given initial capacity.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `add(java.lang.Object listener)` Adds a listener to the list.
`java.lang.Object[]` `getListeners()` Returns an array containing all the registered listeners.
`void` `remove(java.lang.Object listener)` Removes a listener from the list.
`void` `removeAll()` Removes all the listeners from the list.
`int` `size()` Returns the number of registered listeners

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ListenerList

    public ListenerList(int capacity)

Creates a listener list with the given initial capacity.

Parameters:
  `capacity` - the number of listeners which this list can initially accept without growing its internal representation; must be at least 1

### Method Detail

#### add

    public void add(java.lang.Object listener)

Adds a listener to the list. Has no effect if an identical listener is already registered.

Parameters:
  `listener` - a listener

#### getListeners

    public java.lang.Object[] getListeners()

Returns an array containing all the registered listeners. The resulting array is unaffected by subsequent adds or removes. If there are no listeners registered, the result is an empty array singleton instance (no garbage is created). Use this method when notifying listeners, so that any modifications to the listener list during the notification will have no effect on the notification itself.

#### remove

    public void remove(java.lang.Object listener)

Removes a listener from the list. Has no effect if an identical listener was not already registered.

Parameters:
  `listener` - a listener

#### removeAll

    public void removeAll()

Removes all the listeners from the list.

#### size

    public int size()

Returns the number of registered listeners

Returns:
  the number of registered listeners