@Override public synchronized boolean add(Object value) { value = resolveValue(value); Element e = (Element) value; if (initialized) { applyAdd(e); } else { getPending().add(e); } return true; }
@Override public synchronized boolean remove(Object value) { value = resolveValue(value); Element e = (Element) value; if (initialized) { applyRemove(e); } else { getPending().remove(e); } return true; }
private void applyAdd(Element e) { e.clearLocal(); insertLocal(e); }
public synchronized void __tc_applicator_remove(Object key) { getPending().remove(key); }
private void applyPending() { getPending().apply(this); }
private void applyRemove(Element e) { if (present.containsKey(e.getKey())) { removeLocal(e); } }
public void initialize(Comparator<? super Element> comparator) { hardRef(storage); storage.initialize(comparator); }
public synchronized void __tc_applicator_clear() { getPending().clear(); }
public synchronized void __tc_applicator_put(Object key, Object value) { getPending().put(key, value); }
private void applyPending() { if (pendingApply != null) { pendingApply.apply(this); } }
private PendingApply getPending() { if (pending == null) { pending = new PendingApply(); } return pending; }
@Override public void apply(Storage storage) { storage.applyPut(key, value); } }
@Override public void apply(Storage storage) { storage.applyClear(); } }
@Override public synchronized boolean remove(Object value) { value = resolveValue(value); Element e = (Element) value; if (initialized) { applyRemove(e); } else { getPending().remove(e); } return true; }
@Override public synchronized boolean add(Object value) { value = resolveValue(value); Element e = (Element) value; if (initialized) { applyAdd(e); } else { getPending().add(e); } return true; }
private void applyAdd(Element e) { e.clearLocal(); insertLocal(e); }
public void initialize(Comparator<? super Element> comparator) { hardRef(storage); storage.initialize(comparator); }
private void applyPending() { if (pendingApply != null) { pendingApply.apply(this); } }
private PendingApply getPending() { if (pendingApply == null) { pendingApply = new PendingApply(); } return pendingApply; }
void applyPut(Object key, Object value) { if (value instanceof ObjectID) { value = ManagerUtil.lookupObject((ObjectID) value); } Element tw = (Element) value; tw.clearLocal(); insertLocal(tw); }