Exemplo n.º 1
0
 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;
   }
 }
Exemplo n.º 2
0
 public Object get(Object key) {
   String symbol = ((String) key).intern();
   NamedValue value = pkg.lookup(symbol);
   if (value != null) {
     return value.get();
   }
   return null;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 public int size() {
   return pkg.size();
 }