jrummikub.util
Class Event

java.lang.Object
  extended by jrummikub.util.Event
All Implemented Interfaces:
IEvent

public class Event
extends java.lang.Object
implements IEvent

Simple parameterless event generator


Field Summary
private  java.util.HashSet<IListener> listeners
           
 
Constructor Summary
Event()
           
 
Method Summary
 Connection add(IListener listener)
          Start to publish all events to a given listener
 void emit()
          Generate a single event
 void remove(IListener listener)
          Stop publishing events to a given listener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

private java.util.HashSet<IListener> listeners
Constructor Detail

Event

public Event()
Method Detail

add

public Connection add(IListener listener)
Description copied from interface: IEvent
Start to publish all events to a given listener

Specified by:
add in interface IEvent
Parameters:
listener - target listener
Returns:
a connection to remove the listener

remove

public void remove(IListener listener)
Description copied from interface: IEvent
Stop publishing events to a given listener

Specified by:
remove in interface IEvent
Parameters:
listener - target listener

emit

public void emit()
Generate a single event