unc.cdva.events
Class SingleEventSource<T>

java.lang.Object
  extended by unc.cdva.events.SingleEventSource<T>
Direct Known Subclasses:
FengGUIEventRouter, GameTimer, MouseListener

public class SingleEventSource<T>
extends java.lang.Object

Utility class that let's you define a class that can be the source for exactly one type of event.

Author:
Guillaume Conte

Field Summary
protected  java.util.Vector<T> listeners
          Listeners list
 
Constructor Summary
SingleEventSource()
          Constructor which creates a vector to store listeners for the game.
 
Method Summary
 void addListener(T l)
          Adds a new listener to the listeners variable of this class.
 void removeListener(T l)
          Removes a listener from the listeners variable of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected java.util.Vector<T> listeners
Listeners list

Constructor Detail

SingleEventSource

public SingleEventSource()
Constructor which creates a vector to store listeners for the game.

Method Detail

addListener

public void addListener(T l)
Adds a new listener to the listeners variable of this class.

Parameters:
l - The new listener to add

removeListener

public void removeListener(T l)
Removes a listener from the listeners variable of this class.

Parameters:
l - listener to be removed