From 6161c4b1d4d9b5a47775d32dfa198003ddb5afb5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 3 May 2011 17:33:48 +0200 Subject: Rename event and listener methods git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@81 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/util/Event.java | 30 +++++++++++++++--------------- src/jrummikub/util/Event1.java | 4 ++-- src/jrummikub/util/Event2.java | 4 ++-- src/jrummikub/util/IListener.java | 4 ++-- src/jrummikub/util/IListener1.java | 2 +- src/jrummikub/util/IListener2.java | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/jrummikub/util') 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 listeners = new HashSet(); + private HashSet listeners = new HashSet(); - @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 implements IEvent1 { * @param value * the event parameter */ - public void fire(T value) { + public void emit(T value) { for (IListener1 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 implements IEvent2 { * @param value2 * the second event parameter */ - public void fire(T1 value1, T2 value2) { + public void emit(T1 value1, T2 value2) { for (IListener2 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 { * @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 { * @param value2 * the second event parameter */ - public void fire(T1 value1, T2 value2); + public void handle(T1 value1, T2 value2); } -- cgit v1.2.3