diff options
Diffstat (limited to 'src/jrummikub/util')
-rw-r--r-- | src/jrummikub/util/Event.java | 30 | ||||
-rw-r--r-- | src/jrummikub/util/Event1.java | 4 | ||||
-rw-r--r-- | src/jrummikub/util/Event2.java | 4 | ||||
-rw-r--r-- | src/jrummikub/util/IListener.java | 4 | ||||
-rw-r--r-- | src/jrummikub/util/IListener1.java | 2 | ||||
-rw-r--r-- | src/jrummikub/util/IListener2.java | 2 |
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); } |