public Object put(Object key, Object value) { String symbol = ((String) key).intern(); NamedValue binding = pkg.lookup(symbol); if (binding != null) { Object old = binding.get(); binding.set(value); return old; } else { pkg.set(symbol, value); return null; } }
public Object get(Object key) { String symbol = ((String) key).intern(); NamedValue value = pkg.lookup(symbol); if (value != null) { return value.get(); } return null; }
public Set entrySet() { Enumeration e = pkg.bindings(); Set set = new HashSet(); while (e.hasMoreElements()) { NamedValue binding = (NamedValue) e.nextElement(); set.add(new NamedValueEntry(binding)); } return set; }
public int size() { return pkg.size(); }