summaryrefslogtreecommitdiffstats
path: root/mock/jrummikub/util
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-05-10 03:54:48 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-05-10 03:54:48 +0200
commit3b49b2053e9f9d26b73db0ffc8380a60706ee095 (patch)
tree9678d5abb4af070bbf0fd89c684e91f5fd472c31 /mock/jrummikub/util
parent4a860e53cf6f2f97f18785673399498609e6504b (diff)
downloadJRummikub-3b49b2053e9f9d26b73db0ffc8380a60706ee095.tar
JRummikub-3b49b2053e9f9d26b73db0ffc8380a60706ee095.zip
Added all missing comments
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@213 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'mock/jrummikub/util')
-rw-r--r--mock/jrummikub/util/MockEvent.java8
-rw-r--r--mock/jrummikub/util/MockEvent1.java14
-rw-r--r--mock/jrummikub/util/MockEvent2.java17
3 files changed, 33 insertions, 6 deletions
diff --git a/mock/jrummikub/util/MockEvent.java b/mock/jrummikub/util/MockEvent.java
index 65aec9d..3d4c56a 100644
--- a/mock/jrummikub/util/MockEvent.java
+++ b/mock/jrummikub/util/MockEvent.java
@@ -1,8 +1,11 @@
package jrummikub.util;
import java.util.HashSet;
-
+/**
+ * Mock class for Events
+ */
public class MockEvent implements IEvent {
+ /** */
public HashSet<IListener> listeners = new HashSet<IListener>();
@Override
@@ -21,7 +24,8 @@ public class MockEvent implements IEvent {
public void remove(IListener listener) {
listeners.remove(listener);
}
-
+
+ /** */
public void emit() {
for (IListener listener : listeners) {
listener.handle();
diff --git a/mock/jrummikub/util/MockEvent1.java b/mock/jrummikub/util/MockEvent1.java
index 94b0257..7b44c88 100644
--- a/mock/jrummikub/util/MockEvent1.java
+++ b/mock/jrummikub/util/MockEvent1.java
@@ -2,14 +2,21 @@ package jrummikub.util;
import java.util.HashSet;
+/**
+ * Mock class for Event1s
+ *
+ * @param <T>
+ * event type
+ */
public class MockEvent1<T> implements IEvent1<T> {
+ /** */
public HashSet<IListener1<T>> listeners = new HashSet<IListener1<T>>();
@Override
public Connection add(final IListener1<T> listener) {
listeners.add(listener);
- return new Connection() {
-
+ return new Connection() {
+
@Override
public void remove() {
MockEvent1.this.remove(listener);
@@ -22,6 +29,9 @@ public class MockEvent1<T> implements IEvent1<T> {
listeners.remove(listener);
}
+ /**
+ * @param value
+ */
public void emit(T value) {
for (IListener1<T> listener : listeners) {
listener.handle(value);
diff --git a/mock/jrummikub/util/MockEvent2.java b/mock/jrummikub/util/MockEvent2.java
index 5aa7b59..38c9686 100644
--- a/mock/jrummikub/util/MockEvent2.java
+++ b/mock/jrummikub/util/MockEvent2.java
@@ -2,14 +2,23 @@ package jrummikub.util;
import java.util.HashSet;
+/**
+ * Mock class for Event2s
+ *
+ * @param <T1>
+ * first event type
+ * @param <T2>
+ * second event type
+ */
public class MockEvent2<T1, T2> implements IEvent2<T1, T2> {
+ /** */
public HashSet<IListener2<T1, T2>> listeners = new HashSet<IListener2<T1, T2>>();
@Override
public Connection add(final IListener2<T1, T2> listener) {
listeners.add(listener);
- return new Connection() {
-
+ return new Connection() {
+
@Override
public void remove() {
MockEvent2.this.remove(listener);
@@ -22,6 +31,10 @@ public class MockEvent2<T1, T2> implements IEvent2<T1, T2> {
listeners.remove(listener);
}
+ /**
+ * @param value1
+ * @param value2
+ */
public void emit(T1 value1, T2 value2) {
for (IListener2<T1, T2> listener : listeners) {
listener.handle(value1, value2);