package jrummikub.util; import java.util.HashSet; /** * Simple single parameter event generator * * @param * type of the event parameter */ public class Event1 implements IEvent1 { private HashSet> listeners = new HashSet>(); @Override public void add(IListener1 listener) { listeners.add(listener); } @Override public void remove(IListener1 listener) { listeners.remove(listener); } /** * Generate a single event * * @param value * the event parameter */ public void fire(T value) { for (IListener1 listener : listeners) { listener.fire(value); } } }