1 16 19 20 package com.sun.org.apache.xalan.internal.xsltc.compiler.util; 21 22 import java.util.Hashtable ; 23 import java.util.Vector ; 24 25 29 public final class MultiHashtable extends Hashtable { 30 public Object put(Object key, Object value) { 31 Vector vector = (Vector )get(key); 32 if (vector == null) 33 super.put(key, vector = new Vector ()); 34 vector.add(value); 35 return vector; 36 } 37 38 public Object maps(Object from, Object to) { 39 if (from == null) return null; 40 final Vector vector = (Vector ) get(from); 41 if (vector != null) { 42 final int n = vector.size(); 43 for (int i = 0; i < n; i++) { 44 final Object item = vector.elementAt(i); 45 if (item.equals(to)) { 46 return item; 47 } 48 } 49 } 50 return null; 51 } 52 } 53 | Popular Tags |