de.esprit.common.gui.event

## Class GenericEventListenerList

- java.lang.Object
- - de.esprit.common.gui.event.GenericEventListenerList

- All Implemented Interfaces:
    Clearable

      public class GenericEventListenerList
      extends java.lang.Object
      implements Clearable

  This is a genius listener-list that stores event listeners of various types. This list also performs the firing of different kinds of events (all derived from `GenericEvent`). For each type of event it checks for appropriate listeners and calls the appropriate callback method on them (which is determined by reflection).
  Author:
    Rainer Buesch
  See Also:
    `GenericEvent`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericEventListenerList()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(GenericEvent.Listener l)` Adds the given listener to the list.
    `void` | `clear()` Removes all listeners from the list
    `void` | `clearLater()` If clear is done during an event dispatching it must be delayed!
    `boolean` | `contains(GenericEvent.Listener l)` Tells whether the list contains the given Listener
    `void` | `fireEvent(boolean isSafeMode, GenericEvent event)` Fires the given event to the appropriate listeners by calling the event-specific appropriate callback-method on it.
    `void` | `fireEvent(GenericEvent event)` Fires the given event to the appropriate listeners by calling the event-specific appropriate callback-method on it.
    `java.util.List<GenericEvent.Listener>` | `getListeners()` Makes a copy of the inner list accessible for testing purposes.
    `int` | `getSize()`
    `boolean` | `isEmpty()`
    `boolean` | `isNumb()` Tells whether event firing is disabled.
    `void` | `removeListener(GenericEvent.Listener l)` Removes the given listener from the list
    `void` | `removeListenerLater(GenericEvent.Listener l)` If removing is done during an event dispatching it must be delayed!
    `void` | `setNumb(boolean isNumb)` Disables the firing of events.

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

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

- - ### Constructor Detail

    - #### GenericEventListenerList

          public GenericEventListenerList()

  - ### Method Detail

    - #### getListeners

          public java.util.List<GenericEvent.Listener> getListeners()

      Makes a copy of the inner list accessible for testing purposes.

    - #### setNumb

          public void setNumb(boolean isNumb)

      Disables the firing of events.

    - #### isNumb

          public boolean isNumb()

      Tells whether event firing is disabled. Is false by default.

    - #### addListener

          public void addListener(GenericEvent.Listener l)

      Adds the given listener to the list. The listener must be a subclass of GenericEvent.Listener

    - #### contains

          public boolean contains(GenericEvent.Listener l)

      Tells whether the list contains the given Listener

    - #### removeListener

          public void removeListener(GenericEvent.Listener l)

      Removes the given listener from the list

    - #### removeListenerLater

          public void removeListenerLater(GenericEvent.Listener l)

      If removing is done during an event dispatching it must be delayed!

    - #### clear

          public void clear()

      Removes all listeners from the list
      Specified by:
        `clear` in interface `Clearable`

    - #### clearLater

          public void clearLater()

      If clear is done during an event dispatching it must be delayed!

    - #### fireEvent

          public void fireEvent(GenericEvent event)

      Fires the given event to the appropriate listeners by calling the event-specific appropriate callback-method on it.

    - #### fireEvent

          public void fireEvent(boolean isSafeMode,
                       GenericEvent event)

      Fires the given event to the appropriate listeners by calling the event-specific appropriate callback-method on it.
      Parameters:
        `isSafeMode` - avoids concurrent modifications during event-dispatching (slower)

    - #### getSize

          public int getSize()

    - #### isEmpty

          public boolean isEmpty()

Copyright © 2014 EsprIT-Systems. All Rights Reserved.