1 package jrre.event;
2
3 import java.util.ArrayList;
4 import java.util.Iterator;
5
6 public class VMEventDispatcher {
7
8 private ArrayList listenerList;
9
10 public VMEventDispatcher(){
11
12 listenerList = new ArrayList();
13 }
14
15 public void addEventListener(VMEventListener listener){
16
17 System.out.println("add");
18 listenerList.add(listener);
19 }
20
21 public void fireEvent(VMEvent event){
22
23 java.util.ListIterator listenerIterator = listenerList.listIterator();
24
25 while(listenerIterator.hasNext()){
26
27 //System.out.println(event);
28 ((VMEventListener)listenerIterator.next()).receiveEvent(event);
29 }
30 }
31 }
32
This page was automatically generated by Maven