summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jrummikub/util/Connection.java5
-rw-r--r--src/jrummikub/util/Event.java3
-rw-r--r--src/jrummikub/util/Event1.java3
-rw-r--r--src/jrummikub/util/Event2.java3
-rw-r--r--src/jrummikub/util/IEvent.java2
-rw-r--r--src/jrummikub/util/IEvent1.java2
-rw-r--r--src/jrummikub/util/IEvent2.java2
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