Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.2)

E13403-10


oracle.ide.net
Class URLKey

java.lang.Object
  extended by oracle.ide.net.URLKey


public final class URLKey
extends java.lang.Object

A key that can be used to store URLs in java.util.Collection implementations without the performance cost associated with the URL implementation of equals() and hashCode(). Specifically, the URLKey implementation of equals() and hashCode not do InetAddress resolution.

Since:
11.1.2

Method Summary
static java.util.Collection<URLKey> asURLKeys(java.util.Collection<java.net.URL> urls)
          Convert a collection of URL into a collection of URLKey.
static java.util.Collection<java.net.URL> asURLs(java.util.Collection<URLKey> keys)
          Convert a colltion of URLKey into a collection of URL.
 boolean equals(java.lang.Object o)
           
static URLKey getInstance(java.net.URL url)
          Get a URLKey instance for a URL.
 int hashCode()
           
 URLKey intern()
          Returns a canonical representation of the key.
 java.lang.String toString()
           
 java.net.URL toURL()
          Get the URL corresponding to this key.

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Method Detail

getInstance

public static URLKey getInstance(java.net.URL url)
Get a URLKey instance for a URL.
Parameters:
url - the URL
Returns:
the URLKey instance

asURLKeys

public static java.util.Collection<URLKey> asURLKeys(java.util.Collection<java.net.URL> urls)
Convert a collection of URL into a collection of URLKey.
Parameters:
urls - the collection of URL
Returns:
the collection of URLKey

asURLs

public static java.util.Collection<java.net.URL> asURLs(java.util.Collection<URLKey> keys)
Convert a colltion of URLKey into a collection of URL.
Parameters:
keys - the collection of URLKey
Returns:
the collection of URL

toURL

public java.net.URL toURL()
Get the URL corresponding to this key.
Returns:
the URL

intern

public URLKey intern()
Returns a canonical representation of the key. This is useful when the key needs to be stored in memory, as it prevents more than one instance of any URL from being pinned on the heap. It also allows instances to be compared using ==. Interned keys can also be used as keys in an IdentityHashMap.
Returns:
the interned instance

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.2)

E13403-10


Copyright © 1997, 2013, Oracle. All rights reserved.