@Override public void onListUpdate() { Iterator<Entry<IMEMonitorHandlerReceiver<T>, Object>> i = this.listeners.entrySet().iterator(); while (i.hasNext()) { Entry<IMEMonitorHandlerReceiver<T>, Object> e = i.next(); IMEMonitorHandlerReceiver<T> receiver = e.getKey(); if (receiver.isValid(e.getValue())) { receiver.onListUpdate(); } else { i.remove(); } } }
@Override public void postChange(IBaseMonitor<T> monitor, Iterable<T> change, BaseActionSource source) { Iterator<Entry<IMEMonitorHandlerReceiver<T>, Object>> i = this.listeners.entrySet().iterator(); while (i.hasNext()) { Entry<IMEMonitorHandlerReceiver<T>, Object> e = i.next(); IMEMonitorHandlerReceiver<T> receiver = e.getKey(); if (receiver.isValid(e.getValue())) { receiver.postChange(this, change, source); } else { i.remove(); } } }