public Message[] removeDecodedMessages() {
    if (messages_last_read.isEmpty()) return null;

    Message[] msgs = (Message[]) messages_last_read.toArray(new Message[messages_last_read.size()]);

    messages_last_read.clear();

    return msgs;
  }
Exemplo n.º 2
0
 void addListener(Object o) {
   boolean register_with_downloads = false;
   try {
     this_mon.enter();
     register_with_downloads = listeners.isEmpty();
     ArrayList new_listeners = new ArrayList(listeners);
     new_listeners.add(o);
     this.listeners = new_listeners;
   } finally {
     this_mon.exit();
   }
   if (register_with_downloads) {
     dm.addListener(this, true);
   }
 }