Project JXTA

net.jxta.impl.id.binaryID
Class IDFormat

java.lang.Object
  extended bynet.jxta.impl.id.binaryID.IDFormat

public class IDFormat
extends Object

The 'BinaryID' format is a general purpose JXTA ID Format. It implements all of the six standard ID types. It was originally created for the Java 2 SE reference implementation. The 'BinaryID' format uses randomly generated BinaryIDs as the mechanism for generating canonical values for the ids it provides.

Author:
Daniel Brookshier turbogeek@cluck.com

Field Summary
static Instantiator INSTANTIATOR
          The instantiator for this ID Format which is used by the IDFactory.
(package private) static Object[][] wellKnownIDs
          This table maps our local private versions of the well known ids to the globally known version.
 
Method Summary
static String childGroup(PeerGroupID peerGroupID)
          Utility method used to strip only the most significant peer group ID.
static URL getURL(String uniqueValue)
          Public member which returns a URI (URL in Java nomenclature) of the ID.
(package private) static ID translateFromWellKnown(ID input)
          Translate from well known ID to our locally encoded versions.
(package private) static ID translateToWellKnown(ID input)
          Translate from locally encoded versions to the well known versions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wellKnownIDs

static final Object[][] wellKnownIDs
This table maps our local private versions of the well known ids to the globally known version.


INSTANTIATOR

public static final Instantiator INSTANTIATOR
The instantiator for this ID Format which is used by the IDFactory.

Since:
JXTA 1.0
Method Detail

translateFromWellKnown

static ID translateFromWellKnown(ID input)
Translate from well known ID to our locally encoded versions.

Parameters:
input - the id to be translated.
Returns:
the translated ID or the input ID if no translation was needed.
Since:
JXTA 1.0

translateToWellKnown

static ID translateToWellKnown(ID input)
Translate from locally encoded versions to the well known versions.

Parameters:
input - the id to be translated.
Returns:
the translated ID or the input ID if no translation was needed.
Since:
JXTA 1.0

getURL

public 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
Since:
JXTA 1.0

childGroup

public static String childGroup(PeerGroupID peerGroupID)
Utility method used to strip only the most significant peer group ID. This prevents us from continiously appending grandparents to each child.

This method is used in PipeID and PeerID.

Parameters:
peerGroupID - Peer group ID to pull the child from.
Returns:
Child of the peer group.

JXTA J2SE