Ejemplo n.º 1
0
  /**
   * Creates an integer suitable for hash table indexing.
   *
   * <p>The hash code is based upon all the URL components relevant for URL comparison. As such,
   * this operation is a blocking operation.
   *
   * <p>
   *
   * @return a hash code for this <code>URL</code>.
   */
  public synchronized int hashCode() {
    if (hashCode != -1) return hashCode;

    hashCode = handler.hashCode(this);
    return hashCode;
  }
Ejemplo n.º 2
0
 /**
  * Returns a hashcode computed by the URLStreamHandler of this URL
  *
  * @return The hashcode for this URL.
  */
 public int hashCode() {
   if (hashCode != 0) return hashCode; // Use cached value if available.
   else return ph.hashCode(this);
 }