LocalInstance(Updater<AGGREGATOR, SAMPLE> updater) { current = updater.createGenerationInstance(null); }
boolean update(SAMPLE x, Updater<AGGREGATOR, SAMPLE> updater) { synchronized (lock) { current = updater.update(current, x); return isRegistered; } }
AGGREGATOR getAndReset(Updater<AGGREGATOR, SAMPLE> updater) { AGGREGATOR previous; synchronized (lock) { previous = current; current = updater.createGenerationInstance(previous); setRegistered(false); } return previous; }