1 package cz.cuni.amis.utils.listener;
2
3 import java.util.EventListener;
4
5 import cz.cuni.amis.utils.listener.Listeners.ListenerNotifier;
6
7
8
9
10
11
12
13 public interface IListener<T> extends EventListener {
14
15 public void notify(T event);
16
17
18
19
20
21
22
23
24 public static class Notifier<LISTENER extends IListener> implements ListenerNotifier<LISTENER> {
25
26 private Object event;
27
28 public Notifier(Object event) {
29 this.event = event;
30 }
31
32 @Override
33 public Object getEvent() {
34 return event;
35 }
36
37 public void setEvent(Object event) {
38 this.event = event;
39 }
40
41 @Override
42 public void notify(LISTENER listener) {
43 listener.notify(event);
44 }
45
46 }
47
48 }