Example #1
0
 public static void dispatch(String network, boolean val) {
   List<ReceiverIC> list = listeners.get(network);
   if (list != null) {
     for (ReceiverIC ic : list) {
       ic.receive(val);
     }
   }
 }
Example #2
0
 public static void register(ReceiverIC ic) {
   List<ReceiverIC> list = listeners.get(ic.getNetwork());
   if (list == null) {
     list = new LinkedList<ReceiverIC>();
     listeners.put(ic.getNetwork(), list);
   }
   list.add(ic);
 }
Example #3
0
 public static void unregister(ReceiverIC ic) {
   List<ReceiverIC> list = listeners.get(ic.getNetwork());
   if (list != null) {
     list.remove(ic);
     if (list.size() == 0) {
       listeners.remove(ic.getNetwork());
     }
   }
 }