Esempio 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;
   }
 }
Esempio 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;
 }
Esempio 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;
 }
Esempio n. 4
0
 public int size() {
   return pkg.size();
 }