Tabs and spaces.
This commit is contained in:
parent
1ba9fe9cff
commit
b76e6059ae
33 changed files with 306 additions and 306 deletions
|
|
@ -5,21 +5,21 @@ import java.util.List;
|
|||
|
||||
public class Event<T> {
|
||||
private List<Listener<T>> listeners = new LinkedList<Listener<T>>();
|
||||
|
||||
|
||||
public synchronized void addListener(Listener<T> l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
|
||||
|
||||
public synchronized void removeListener(Listener<T> l) {
|
||||
listeners.remove(l);
|
||||
}
|
||||
|
||||
|
||||
public synchronized void trigger(T t) {
|
||||
for (Listener<T> l : listeners) {
|
||||
l.triggered(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public interface Listener<T> {
|
||||
void triggered(T t);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue