Пример #1
0
 public void removeAttributeListener(
     DownloadAttributeListener listener, TorrentAttribute ta, int event_type) {
   Map attr_map = getAttributeListenerMap(event_type);
   DownloadAttributeNotifier l = (DownloadAttributeNotifier) attr_map.get(ta);
   if (l == null) {
     return;
   }
   l.removeListener(listener);
 }
Пример #2
0
 public void addAttributeListener(
     DownloadAttributeListener listener, TorrentAttribute ta, int event_type) {
   Map attr_map = getAttributeListenerMap(event_type);
   DownloadAttributeNotifier l = (DownloadAttributeNotifier) attr_map.get(ta);
   if (l == null) {
     l = new DownloadAttributeNotifier(ta, event_type);
     attr_map.put(ta, l);
   }
   l.addListener(listener);
 }