From 53824198db2bade71c895c91caab14f338139fd2 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Thu, 5 May 2011 19:49:59 +0200 Subject: Added tests for Connection git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@150 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/util/Connection.java | 5 +++++ src/jrummikub/util/Event.java | 3 ++- src/jrummikub/util/Event1.java | 3 ++- src/jrummikub/util/Event2.java | 3 ++- src/jrummikub/util/IEvent.java | 2 +- src/jrummikub/util/IEvent1.java | 2 +- src/jrummikub/util/IEvent2.java | 2 +- 7 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 src/jrummikub/util/Connection.java (limited to 'src/jrummikub') diff --git a/src/jrummikub/util/Connection.java b/src/jrummikub/util/Connection.java new file mode 100644 index 0000000..b6a5a07 --- /dev/null +++ b/src/jrummikub/util/Connection.java @@ -0,0 +1,5 @@ +package jrummikub.util; + +public interface Connection { + public void remove(); +} diff --git a/src/jrummikub/util/Event.java b/src/jrummikub/util/Event.java index 64a70b3..f76b861 100644 --- a/src/jrummikub/util/Event.java +++ b/src/jrummikub/util/Event.java @@ -7,8 +7,9 @@ public class Event implements IEvent { private HashSet listeners = new HashSet(); @Override - public void add(IListener listener) { + public Connection add(IListener listener) { listeners.add(listener); + return null; } @Override diff --git a/src/jrummikub/util/Event1.java b/src/jrummikub/util/Event1.java index 3f5056d..ff6c037 100644 --- a/src/jrummikub/util/Event1.java +++ b/src/jrummikub/util/Event1.java @@ -12,8 +12,9 @@ public class Event1 implements IEvent1 { private HashSet> listeners = new HashSet>(); @Override - public void add(IListener1 listener) { + public Connection add(IListener1 listener) { listeners.add(listener); + return null; } @Override diff --git a/src/jrummikub/util/Event2.java b/src/jrummikub/util/Event2.java index 764004f..4b6575f 100644 --- a/src/jrummikub/util/Event2.java +++ b/src/jrummikub/util/Event2.java @@ -14,8 +14,9 @@ public class Event2 implements IEvent2 { private HashSet> listeners = new HashSet>(); @Override - public void add(IListener2 listener) { + public Connection add(IListener2 listener) { listeners.add(listener); + return null; } @Override diff --git a/src/jrummikub/util/IEvent.java b/src/jrummikub/util/IEvent.java index 3aa13ba..52893f2 100644 --- a/src/jrummikub/util/IEvent.java +++ b/src/jrummikub/util/IEvent.java @@ -8,7 +8,7 @@ public interface IEvent { * @param listener * target listener */ - public void add(IListener listener); + public Connection add(IListener listener); /** * Stop publishing events to a given listener diff --git a/src/jrummikub/util/IEvent1.java b/src/jrummikub/util/IEvent1.java index 52b9bf4..fa031b8 100644 --- a/src/jrummikub/util/IEvent1.java +++ b/src/jrummikub/util/IEvent1.java @@ -13,7 +13,7 @@ public interface IEvent1 { * @param listener * target listener */ - public void add(IListener1 listener); + public Connection add(IListener1 listener); /** * Stop publishing events to a given listener diff --git a/src/jrummikub/util/IEvent2.java b/src/jrummikub/util/IEvent2.java index 967b65c..70bb3e6 100644 --- a/src/jrummikub/util/IEvent2.java +++ b/src/jrummikub/util/IEvent2.java @@ -15,7 +15,7 @@ public interface IEvent2 { * @param listener * target listener */ - public void add(IListener2 listener); + public Connection add(IListener2 listener); /** * Stop publishing events to a given listener -- cgit v1.2.3