projects
/
jSite2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use NodeListener support class.
[jSite2.git]
/
src
/
net
/
pterodactylus
/
util
/
event
/
ListenerSupport.java
diff --git
a/src/net/pterodactylus/util/event/ListenerSupport.java
b/src/net/pterodactylus/util/event/ListenerSupport.java
index
1b11296
..
a339d27
100644
(file)
--- a/
src/net/pterodactylus/util/event/ListenerSupport.java
+++ b/
src/net/pterodactylus/util/event/ListenerSupport.java
@@
-20,36
+20,22
@@
package net.pterodactylus.util.event;
import java.util.ArrayList;
package net.pterodactylus.util.event;
import java.util.ArrayList;
+import java.util.EventListener;
import java.util.List;
/**
import java.util.List;
/**
- * Helper class
to ease listener
management.
+ * Helper class
for {@link EventListener}
management.
*
*
- * @param <S>
- * The type of the source
* @param <L>
* @param <L>
- * The type of the
listeners
- * @author David
‘Bombe’ Roden <bombe@freenetproject.org
>
+ * The type of the
event listener
+ * @author David
Roden <droden@gmail.com
>
*/
*/
-public class ListenerSupport<S, L> {
-
- /** The source of the events. */
- private final S source;
+public class ListenerSupport<L extends EventListener> {
/** The list of registered listeners. */
private final List<L> listeners = new ArrayList<L>();
/**
/** The list of registered listeners. */
private final List<L> listeners = new ArrayList<L>();
/**
- * Creates a new listener support.
- *
- * @param source
- * The source of all events
- */
- public ListenerSupport(S source) {
- this.source = source;
- }
-
- /**
* Adds a listener to the list of registered listeners.
*
* @param listener
* Adds a listener to the list of registered listeners.
*
* @param listener
@@
-73,23
+59,11
@@
public class ListenerSupport<S, L> {
}
}
}
}
- //
- // PROTECTED METHODS
- //
-
- /**
- * Returns the source of all events.
- *
- * @return The source of all events
- */
- protected S getSource() {
- return source;
- }
-
/**
* Returns a list of all listeners. This list is a copy of the internally
* kept list and as thus will not be modified by calls to
/**
* Returns a list of all listeners. This list is a copy of the internally
* kept list and as thus will not be modified by calls to
- * {@link #addListener(Object)} or {@link #removeListener(Object)}.
+ * {@link #addListener(EventListener)} or
+ * {@link #removeListener(EventListener)}.
*
* @return The list of all listeners
*/
*
* @return The list of all listeners
*/
@@
-99,4
+73,6
@@
public class ListenerSupport<S, L> {
}
}
}
}
+ /* TODO */
+
}
}