1 package jfun.yan.xml; 2 3 final class SeqRegistry implements Registry { 4 private final Registry r1; 5 private final Registry r2; 6 public void put(String key, Object val, Location loc) { 7 r1.put(key, val, loc); 8 r2.put(key, val, loc); 9 } 10 SeqRegistry(Registry r1, Registry r2) { 11 this.r1 = r1; 12 this.r2 = r2; 13 } 14 public boolean equals(Object obj) { 15 if(obj instanceof SeqRegistry){ 16 final SeqRegistry other =(SeqRegistry)obj; 17 return r1.equals(other.r1) && r2.equals(other.r2); 18 } 19 else return false; 20 } 21 public int hashCode() { 22 return r1.hashCode()*31+r2.hashCode(); 23 } 24 public String toString() { 25 return r1.toString()+","+r2.toString(); 26 } 27 28 29 } 30 | Popular Tags |