JXTA

net.jxta.impl.id.unknown
Class ID

java.lang.Object
  extended by net.jxta.id.ID
      extended by net.jxta.impl.id.unknown.ID
All Implemented Interfaces:
Serializable

public final class ID
extends ID

IDs are used to uniquely identify peers, peer groups, pipes and other types of objects manipulated by the JXTA APIs.

See Also:
IDFactory, CodatID, PeerID, PeerGroupID, PipeID, ModuleClassID, ModuleSpecID, Serialized Form

Field Summary
(package private)  String unqiueValue
           
 
Fields inherited from class net.jxta.id.ID
nullID, URIEncodingName, URNNamespace
 
Constructor Summary
ID(String value)
          Constructor for IDs.
 
Method Summary
 boolean equals(Object target)
          
 String getIDFormat()
          Returns a string identifier which indicates which ID format is used by this ID instance.
 Object getUniqueValue()
          Returns an object containing the unique value of the ID.
 URL getURL()
          Returns a URL representation of the ID.
(package private) static URL getURL(String uniqueValue)
          Public member which returns a URI (URL in Java nomenclature) of the ID.
 int hashCode()
          
 URI toURI()
          Returns a URI representation of the ID.
 
Methods inherited from class net.jxta.id.ID
create, intern, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

unqiueValue

String unqiueValue
Constructor Detail

ID

ID(String value)
Constructor for IDs.

Method Detail

equals

public boolean equals(Object target)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

getIDFormat

public String getIDFormat()
Returns a string identifier which indicates which ID format is used by this ID instance.

Specified by:
getIDFormat in class ID
Returns:
a string identifier which indicates which ID format is used by this ID instance.

getUniqueValue

public Object getUniqueValue()
Returns an object containing the unique value of the ID. This object must provide implementations of toString(), equals() and hashCode() that are canonical and consistent from run-to-run given the same input values. Beyond this nothing should be assumed about the nature of this object. For some implementations the object returned may be this.

Specified by:
getUniqueValue in class ID
Returns:
Object which can provide canonical representations of the ID.

getURL

public URL getURL()
Returns a URL representation of the ID. The JXTA ID Factory can be used to construct ID Objects from URLs containing JXTA IDs.

Overrides:
getURL in class ID
Returns:
URL Object containing the URI
See Also:
IDFactory.fromURL( java.net.URL )

getURL

static URL getURL(String uniqueValue)
Public member which returns a URI (URL in Java nomenclature) of the ID.

Parameters:
uniqueValue - the unique portion of the ID
Returns:
URL Object containing the URI

toURI

public URI toURI()
Returns a URI representation of the ID. URIs are the preferred way of externalizing and presenting JXTA IDs. The JXTA ID Factory can be used to construct ID Objects from URIs containing JXTA IDs.

Overrides:
toURI in class ID
Returns:
URI Object containing the URI
See Also:
IDFactory.fromURI( java.net.URI )

JXSE