|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgap.event.EventManager
Manages event notification in the system. Observers that desire to be notified of genetic events should subscribe to this class via the addEventListener() method. To unsubscribe, use the removeEventListener() method. To generate a genetic event, use the fireGeneticEvent() method, which will take care of notifying the appropriate subscribers.
Constructor Summary | |
EventManager()
|
Method Summary | |
void |
addEventListener(java.lang.String a_eventName,
GeneticEventListener a_eventListenerToAdd)
Adds a new listener that will be notified when the event represented by the given name is fired. |
void |
fireGeneticEvent(GeneticEvent a_eventToFire)
Fires a genetic event. |
void |
removeEventListener(java.lang.String a_eventName,
GeneticEventListener a_eventListenerToRemove)
Removes the given listener from subscription of the indicated event. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EventManager()
Method Detail |
public void addEventListener(java.lang.String a_eventName, GeneticEventListener a_eventListenerToAdd)
a_eventName
- the name of the event to which the given listener
should be subscribed. Standard events are
represented by constants in the GeneticEvent class.a_eventListenerToAdd
- the genetic listener to subscribe to
notifications of the given event.public void removeEventListener(java.lang.String a_eventName, GeneticEventListener a_eventListenerToRemove)
a_eventName
- the name of the event to which the given listener
should be removed. Standard events are
represented by constants in the GeneticEvent class.a_eventListenerToRemove
- the genetic listener to unsubscribe from
notifications of the given event.public void fireGeneticEvent(GeneticEvent a_eventToFire)
a_eventToFire
- The representation of the GeneticEvent to fire.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |