/** * Create a String representation of the IdMap. * * @param s is the String in which the */ public String toString() { String s = "{ "; for (int i = firstId(); i != 0; i = nextId(i)) { s += "(" + ht.getKey(i) + "," + i + ") "; } return s + "}"; }
/** * Get the key that was mapped to the given identifier * * @param id is the identifier whose key is to be returned * @return the key that maps to id, or 0 if there is none */ public long getKey(int id) { return (validId(id) ? ht.getKey(id) : 0); }