1 package jfun.yan.xml; 2 3 import java.util.Map ; 4 5 final class Map2Registry implements Registry { 6 private final Map map; 7 8 Map2Registry(Map map) { 9 this.map = map; 10 } 11 public void put(String key, Object v, Location loc){ 12 map.put(key, v); 13 } 14 public String toString(){ 15 return map.toString(); 16 } 17 Map getMap() { 18 return map; 19 } 20 public boolean equals(Object obj) { 21 if(obj instanceof Map2Registry){ 22 final Map2Registry other = (Map2Registry)obj; 23 return map==other.map; 24 } 25 else return false; 26 } 27 public int hashCode() { 28 return System.identityHashCode(map); 29 } 30 31 } 32 | Popular Tags |