public void unset(final String name) { assert name != null; ensureMutable(name); map.remove(name); if (eventManager != null) { eventManager.publish(new VariableUnsetEvent(name)); } }
public void onEvent(final EventObject event) throws Exception { if (event instanceof VariableSetEvent) { VariableSetEvent target = (VariableSetEvent) event; delegate.getStrings().add(target.getName()); } else if (event instanceof VariableUnsetEvent) { VariableUnsetEvent target = (VariableUnsetEvent) event; delegate.getStrings().remove(target.getName()); } } });