diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-05 19:49:59 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-05 19:49:59 +0200 |
commit | 53824198db2bade71c895c91caab14f338139fd2 (patch) | |
tree | 8f1f6f10c91bec59292e2a5980ea1346b12c6d79 /src/jrummikub/util | |
parent | 44ee94041a1f042408033663df992803a2970872 (diff) | |
download | JRummikub-53824198db2bade71c895c91caab14f338139fd2.tar JRummikub-53824198db2bade71c895c91caab14f338139fd2.zip |
Added tests for Connection
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@150 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/util')
-rw-r--r-- | src/jrummikub/util/Connection.java | 5 | ||||
-rw-r--r-- | src/jrummikub/util/Event.java | 3 | ||||
-rw-r--r-- | src/jrummikub/util/Event1.java | 3 | ||||
-rw-r--r-- | src/jrummikub/util/Event2.java | 3 | ||||
-rw-r--r-- | src/jrummikub/util/IEvent.java | 2 | ||||
-rw-r--r-- | src/jrummikub/util/IEvent1.java | 2 | ||||
-rw-r--r-- | src/jrummikub/util/IEvent2.java | 2 |
7 files changed, 14 insertions, 6 deletions
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<IListener> listeners = new HashSet<IListener>(); @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<T> implements IEvent1<T> { private HashSet<IListener1<T>> listeners = new HashSet<IListener1<T>>(); @Override - public void add(IListener1<T> listener) { + public Connection add(IListener1<T> 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<T1, T2> implements IEvent2<T1, T2> { private HashSet<IListener2<T1, T2>> listeners = new HashSet<IListener2<T1, T2>>(); @Override - public void add(IListener2<T1, T2> listener) { + public Connection add(IListener2<T1, T2> 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<T> { * @param listener * target listener */ - public void add(IListener1<T> listener); + public Connection add(IListener1<T> 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<T1, T2> { * @param listener * target listener */ - public void add(IListener2<T1, T2> listener); + public Connection add(IListener2<T1, T2> listener); /** * Stop publishing events to a given listener |