code: private Object toReference(int type, Object referent, int hash)
      {
          switch (type)
          {
              case HARD:
                  return referent;
              case SOFT:
                  return new SoftRef(hash, referent, queue);
              case WEAK:
                  return new WeakRef(hash, referent, queue);
              default:
                  throw new Error();
          }
      }
docs: Constructs a reference of the given type to the given
  referent.  The reference is registered with the queue
  for later purging.
  
  @param type  HARD, SOFT or WEAK
  @param referent  the object to refer to
  @param hash  the hash code of the <I>key</I> of the mapping;
  this number might be different from referent.hashCode() if
  the referent represents a value and not a key