util
Class SimEventTarget

java.lang.Object
  extended by util.SimEventTarget

public class SimEventTarget
extends java.lang.Object

This class defines the sim events dispatcher. It allows listeners to be registered to receive events based on event type. When an event is passed to "dispatchEvent()" the listeners registered for the event type are called successively in the order they were registered.


Constructor Summary
SimEventTarget()
          Create an instance of a sim event target object.
 
Method Summary
 void addEventListener(java.lang.String type, SimEventListener listener)
          Add an event listener for a given event type.
 void dispatchEvent(SimEvent event)
          Dispatch an event to the listeners registered for its type.
 void Print()
          Print a string representation of the queue and its current contents.
 void removeEventListener(java.lang.String type, SimEventListener listener)
          Remove an event listener for a given event type.
 java.lang.String toString()
          Get a string representation of the queue and its current contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimEventTarget

public SimEventTarget()
Create an instance of a sim event target object.

Method Detail

addEventListener

public void addEventListener(java.lang.String type,
                             SimEventListener listener)
Add an event listener for a given event type. Multiple listeners for a single event type will be called in the order they are registered.

Parameters:
type - the event type for this listener. If null the listener will be called for every event type before the listeners for any specific type.
listener - the event listener to add.

removeEventListener

public void removeEventListener(java.lang.String type,
                                SimEventListener listener)
Remove an event listener for a given event type.

Parameters:
type - the event type for this listener.
listener - the event listener to remove.

dispatchEvent

public void dispatchEvent(SimEvent event)
Dispatch an event to the listeners registered for its type.

Parameters:
event - the event to dispatch to its registered listeners.

toString

public java.lang.String toString()
Get a string representation of the queue and its current contents.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of the contents.

Print

public void Print()
Print a string representation of the queue and its current contents.