1 27 28 package org.objectweb.speedo.pobjects.map; 29 30 import java.util.Map ; 31 import java.util.HashMap ; 32 33 public class Registry { 34 35 public String name; 36 37 public Map bindings; 38 39 public Registry () { 40 } 41 42 public Registry (String name) { 43 this.name = name; 44 bindings = new HashMap (); 45 } 46 47 public void bind (String name, Object value) { 48 bindings.put(name, value); 49 } 50 51 public Object lookup (String name) { 52 return bindings.get(name); 53 } 54 55 public boolean equals (Object o) { 56 return (o instanceof Registry) && ((Registry) o).name.equals(name); 57 } 58 59 public int hashCode () { 60 return name.hashCode(); 61 } 62 } 63 | Popular Tags |