summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/util
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-05-03 17:33:48 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-05-03 17:33:48 +0200
commit6161c4b1d4d9b5a47775d32dfa198003ddb5afb5 (patch)
tree895332fecb75ae2832b0c4cf3247facebf748190 /src/jrummikub/util
parentbcc3f95847eafa1b61bb32dac047101c7adc0e64 (diff)
downloadJRummikub-6161c4b1d4d9b5a47775d32dfa198003ddb5afb5.tar
JRummikub-6161c4b1d4d9b5a47775d32dfa198003ddb5afb5.zip
Rename event and listener methods
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@81 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/util')
-rw-r--r--src/jrummikub/util/Event.java30
-rw-r--r--src/jrummikub/util/Event1.java4
-rw-r--r--src/jrummikub/util/Event2.java4
-rw-r--r--src/jrummikub/util/IListener.java4
-rw-r--r--src/jrummikub/util/IListener1.java2
-rw-r--r--src/jrummikub/util/IListener2.java2
6 files changed, 23 insertions, 23 deletions
diff --git a/src/jrummikub/util/Event.java b/src/jrummikub/util/Event.java
index 698e0ed..64a70b3 100644
--- a/src/jrummikub/util/Event.java
+++ b/src/jrummikub/util/Event.java
@@ -4,22 +4,22 @@ import java.util.HashSet;
/** Simple parameterless event generator */
public class Event implements IEvent {
- private HashSet<IListener> listeners = new HashSet<IListener>();
+ private HashSet<IListener> listeners = new HashSet<IListener>();
- @Override
- public void add(IListener listener) {
- listeners.add(listener);
- }
+ @Override
+ public void add(IListener listener) {
+ listeners.add(listener);
+ }
- @Override
- public void remove(IListener listener) {
- listeners.remove(listener);
- }
+ @Override
+ public void remove(IListener listener) {
+ listeners.remove(listener);
+ }
- /** Generate a single event */
- public void fire() {
- for (IListener listener : listeners) {
- listener.fire();
- }
- }
+ /** Generate a single event */
+ public void emit() {
+ for (IListener listener : listeners) {
+ listener.handle();
+ }
+ }
}
diff --git a/src/jrummikub/util/Event1.java b/src/jrummikub/util/Event1.java
index 8ddf2a5..3f5056d 100644
--- a/src/jrummikub/util/Event1.java
+++ b/src/jrummikub/util/Event1.java
@@ -27,9 +27,9 @@ public class Event1<T> implements IEvent1<T> {
* @param value
* the event parameter
*/
- public void fire(T value) {
+ public void emit(T value) {
for (IListener1<T> listener : listeners) {
- listener.fire(value);
+ listener.handle(value);
}
}
}
diff --git a/src/jrummikub/util/Event2.java b/src/jrummikub/util/Event2.java
index f89446e..764004f 100644
--- a/src/jrummikub/util/Event2.java
+++ b/src/jrummikub/util/Event2.java
@@ -31,9 +31,9 @@ public class Event2<T1, T2> implements IEvent2<T1, T2> {
* @param value2
* the second event parameter
*/
- public void fire(T1 value1, T2 value2) {
+ public void emit(T1 value1, T2 value2) {
for (IListener2<T1, T2> listener : listeners) {
- listener.fire(value1, value2);
+ listener.handle(value1, value2);
}
}
}
diff --git a/src/jrummikub/util/IListener.java b/src/jrummikub/util/IListener.java
index 9030f71..f805452 100644
--- a/src/jrummikub/util/IListener.java
+++ b/src/jrummikub/util/IListener.java
@@ -4,6 +4,6 @@ package jrummikub.util;
* Interface for classes that can receive parameterless events
*/
public interface IListener {
- /** This method is called whenever a class we're listening to emits an event */
- public void fire();
+ /** This method is called whenever a class we're listening to emits an event */
+ public void handle();
}
diff --git a/src/jrummikub/util/IListener1.java b/src/jrummikub/util/IListener1.java
index c5e7253..5a01569 100644
--- a/src/jrummikub/util/IListener1.java
+++ b/src/jrummikub/util/IListener1.java
@@ -14,5 +14,5 @@ public interface IListener1<T> {
* @param value
* the event parameter
*/
- public void fire(T value);
+ public void handle(T value);
}
diff --git a/src/jrummikub/util/IListener2.java b/src/jrummikub/util/IListener2.java
index 1733208..dd571a3 100644
--- a/src/jrummikub/util/IListener2.java
+++ b/src/jrummikub/util/IListener2.java
@@ -18,5 +18,5 @@ public interface IListener2<T1, T2> {
* @param value2
* the second event parameter
*/
- public void fire(T1 value1, T2 value2);
+ public void handle(T1 value1, T2 value2);
}