package jrummikub.util; import java.util.HashSet; /** Simple parameterless event generator */ public class Event implements IEvent { private HashSet listeners = new HashSet(); @Override public void add(IListener listener) { listeners.add(listener); } @Override public void remove(IListener listener) { listeners.remove(listener); } /** Generate a single event */ public void fire() { for (IListener listener : listeners) { listener.fire(); } } }