From fe019e5eae8d8e740d7620044727988c6d28a423 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 4 May 2011 21:40:11 +0200 Subject: Make mock events emittable git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@123 72836036-5685-4462-b002-a69064685172 --- test/jrummikub/util/MockEvent.java | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'test/jrummikub/util/MockEvent.java') diff --git a/test/jrummikub/util/MockEvent.java b/test/jrummikub/util/MockEvent.java index 85f2c28..2f0efe5 100644 --- a/test/jrummikub/util/MockEvent.java +++ b/test/jrummikub/util/MockEvent.java @@ -4,14 +4,20 @@ import java.util.HashSet; public class MockEvent implements IEvent { public HashSet listeners = new HashSet(); - + + @Override + public void add(IListener listener) { + listeners.add(listener); + } + @Override - public void add(IListener listener) { - listeners.add(listener); - } + public void remove(IListener listener) { + listeners.remove(listener); + } - @Override - public void remove(IListener listener) { - listeners.remove(listener); - } + public void emit() { + for (IListener listener : listeners) { + listener.handle(); + } + } } -- cgit v1.2.3