/** Remove some children from the list by key. * @param keys collection of keys to remove */ protected final void removeAll(final Collection<? extends T> keys) { try { PR.enterWriteAccess(); getMap().keySet().removeAll(keys); refreshImpl(); } finally { PR.exitWriteAccess(); } }
/** Add a collection of new key/value pairs into the map. * The supplied map may contain any keys, but the values must be {@link Node}s. * * @param map the map with pairs to add */ protected final void putAll(final java.util.Map<? extends T,? extends Node> map) { try { PR.enterWriteAccess(); getMap().putAll(map); refreshImpl(); // PENDING sometime we should also call refreshKey... } finally { PR.exitWriteAccess(); } }
/** Add one key and one node to the list. * @param key the key * @param node the node */ protected final void put(final T key, final Node node) { try { PR.enterWriteAccess(); if (getMap().put(key, node) != null) { refreshKeyImpl(key); } else { refreshImpl(); } } finally { PR.exitWriteAccess(); } }
/** Allows subclasses that directly modifies the * map with nodes to synchronize the state of the children. * This method should be called under * MUTEX.writeAccess. */ final void refreshImpl () { this.setEntries (createEntries (getMap ())); }
/** Called on first use. */ final void callAddNotify () { this.setEntries (createEntries (getMap ())); super.callAddNotify (); }
/** Allows subclasses that directly modifies the * map with nodes to synchronize the state of the children. * This method should be called under * MUTEX.writeAccess. */ final void refreshImpl () { this.setEntries (createEntries (getMap ())); }
/** Called on first use. */ final void callAddNotify () { this.setEntries (createEntries (getMap ())); super.callAddNotify (); }
/** Allows subclasses that directly modifies the * map with nodes to synchronize the state of the children. * This method should be called under * MUTEX.writeAccess. */ final void refreshImpl() { entrySupport().setEntries(createEntries(getMap())); }
/** Called on first use. */ @Override final void callAddNotify() { entrySupport().setEntries(createEntries(getMap()), true); super.callAddNotify(); }