public synchronized void notify(UpdateClient updateclient, long l, Object obj) { long l1 = System.currentTimeMillis() + l; long l2 = first == null ? -1L : first.when; if (first != null) if (first.client == updateclient && first.arg == obj) { if (l1 >= first.when) return; first = first.next; } else { for (ScreenUpdaterEntry screenupdaterentry = first; screenupdaterentry.next != null; screenupdaterentry = screenupdaterentry.next) { if (screenupdaterentry.next.client != updateclient || screenupdaterentry.next.arg != obj) continue; if (l1 >= screenupdaterentry.next.when) return; screenupdaterentry.next = screenupdaterentry.next.next; break; } } if (first == null || first.when > l1) { first = new ScreenUpdaterEntry(updateclient, l1, obj, first); } else { ScreenUpdaterEntry screenupdaterentry1 = first; do { if (screenupdaterentry1.next == null || screenupdaterentry1.next.when > l1) { screenupdaterentry1.next = new ScreenUpdaterEntry(updateclient, l1, obj, screenupdaterentry1.next); break; } screenupdaterentry1 = screenupdaterentry1.next; } while (true); } if (l2 != first.when) super.notify(); }
public synchronized void removeClient(UpdateClient updateclient) { ScreenUpdaterEntry screenupdaterentry = first; ScreenUpdaterEntry screenupdaterentry1 = null; for (; screenupdaterentry != null; screenupdaterentry = screenupdaterentry.next) if (screenupdaterentry.client.equals(updateclient)) { if (screenupdaterentry1 == null) first = screenupdaterentry.next; else screenupdaterentry1.next = screenupdaterentry.next; } else { screenupdaterentry1 = screenupdaterentry; } }