This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
JRummikub/mock/jrummikub/util/MockEvent2.java
Matthias Schiffer 433a0c3561 Moved mock classes to separate source folder
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@142 72836036-5685-4462-b002-a69064685172
2011-05-05 13:16:46 +02:00

23 lines
520 B
Java

package jrummikub.util;
import java.util.HashSet;
public class MockEvent2<T1, T2> implements IEvent2<T1, T2> {
public HashSet<IListener2<T1, T2>> listeners = new HashSet<IListener2<T1, T2>>();
@Override
public void add(IListener2<T1, T2> listener) {
listeners.add(listener);
}
@Override
public void remove(IListener2<T1, T2> listener) {
listeners.remove(listener);
}
public void emit(T1 value1, T2 value2) {
for (IListener2<T1, T2> listener : listeners) {
listener.handle(value1, value2);
}
}
}