package jrummikub.util; import java.util.HashSet; /** * Simple single parameter event generator * * @param * type of the first event parameter * @param * type of the second event parameter */ public class Event2 implements IEvent2 { private HashSet> listeners = new HashSet>(); @Override public void add(IListener2 listener) { listeners.add(listener); } @Override public void remove(IListener2 listener) { listeners.remove(listener); } /** * Generate a single event * * @param value1 * the first event parameter * @param value2 * the second event parameter */ public void fire(T1 value1, T2 value2) { for (IListener2 listener : listeners) { listener.fire(value1, value2); } } }