Ejemplo n.º 1
0
 /**
  * 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 + "}";
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }