KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > event > IEventManager


1 /*
2  * This file is part of JGAP.
3  *
4  * JGAP offers a dual license model containing the LGPL as well as the MPL.
5  *
6  * For licencing information please see the file license.txt included with JGAP
7  * or have a look at the top of class org.jgap.Chromosome which representatively
8  * includes the JGAP license policy applicable for any file delivered with JGAP.
9  */

10 package org.jgap.event;
11
12 import java.io.*;
13
14 /**
15  * Interface for event managers (e.g., see class EventManager).
16  *
17  * @author Klaus Meffert
18  * @author Neil Rotstan
19  * @since 2.6
20  */

21 public interface IEventManager
22     extends Serializable {
23   /**
24    * Adds a new listener that will be notified when the event represented
25    * by the given name is fired.
26    *
27    * @param a_eventName the name of the event to which the given listener
28    * should be subscribed. Standard events are represented by constants in the
29    * GeneticEvent class
30    * @param a_eventListenerToAdd the genetic listener to subscribe to
31    * notifications of the given event
32    *
33    * @author Neil Rotstan
34    * @since 2.6 (since 1.0 in EventManager)
35    */

36   void addEventListener(String JavaDoc a_eventName,
37                         GeneticEventListener a_eventListenerToAdd);
38
39   /**
40    * Removes the given listener from subscription of the indicated event.
41    * The listener will no longer be notified when the given event occurs.
42    *
43    * @param a_eventName the name of the event to which the given listener
44    * should be removed. Standard events are represented by constants in the
45    * GeneticEvent class
46    * @param a_eventListenerToRemove the genetic listener to unsubscribe from
47    * notifications of the given event
48    *
49    * @author Neil Rotstan
50    * @since 2.6 (since 1.0 in EventManager)
51    */

52   void removeEventListener(String JavaDoc a_eventName,
53                            GeneticEventListener a_eventListenerToRemove);
54
55   /**
56    * Fires a genetic event. All subscribers of that particular event type
57    * (as determined by the name of the event) will be notified of it
58    * having been fired.
59    *
60    * @param a_eventToFire the representation of the GeneticEvent to fire
61    *
62    * @author Neil Rotstan
63    * @since 2.6 (since 1.0 in EventManager)
64    */

65   void fireGeneticEvent(GeneticEvent a_eventToFire);
66 }
67
Popular Tags