JXTA

net.jxta.impl.id.binaryID
Class CodatBinaryID

java.lang.Object
  extended by net.jxta.id.ID
      extended by net.jxta.codat.CodatID
          extended by net.jxta.impl.id.binaryID.CodatBinaryID
All Implemented Interfaces:
Serializable

public final class CodatBinaryID
extends CodatID

This class implements a Pipe ID. Each pipe is assigned a unique id.

Author:
Daniel Brookshier turbogeek@cluck.com
See Also:
ID, IDFactory, PeerGroupID, Serialized Form

Field Summary
protected  String id
          The id data
 
Fields inherited from class net.jxta.id.ID
nullID, URIEncodingName, URNNamespace
 
Constructor Summary
protected CodatBinaryID()
          Used only internally
  CodatBinaryID(BinaryID id)
          Constructor.
  CodatBinaryID(PeerGroupID parent, byte[] data, boolean lengthIncluded)
          Constructor.
  CodatBinaryID(PeerGroupID groupID, byte[] seed, InputStream in)
           
  CodatBinaryID(PeerGroupID groupID, InputStream in)
           
  CodatBinaryID(String id)
          Creates a ID from a string.
 
Method Summary
 boolean equals(Object target)
          
protected  String getID()
          returns the coded ID without the binaryid tag.
 String getIDFormat()
          Returns a string identifier which indicates which ID format is used by this ID instance.
 ID getPeerGroupID()
          Returns PeerGroupID of the Peer Group to which this Codat ID belongs.
 Object getUniqueValue()
          Returns an object containing the unique value of the ID.
 int hashCode()
          
 boolean isStatic()
          Returns true if this CodatID is associated with a static Codat.
 
Methods inherited from class net.jxta.codat.CodatID
create, intern
 
Methods inherited from class net.jxta.id.ID
getURL, toString, toURI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected String id
The id data

Constructor Detail

CodatBinaryID

protected CodatBinaryID()
Used only internally


CodatBinaryID

public CodatBinaryID(String id)
Creates a ID from a string. Note that the ID is not currently validated.

Parameters:
id - Value of ID.

CodatBinaryID

public CodatBinaryID(BinaryID id)
Constructor. Intializes contents from provided ID.

Parameters:
id - the ID data

CodatBinaryID

public CodatBinaryID(PeerGroupID parent,
                     byte[] data,
                     boolean lengthIncluded)
Constructor. Creates a PipeID. A PeerGroupID is provided. Note that only the peer group's primary node is used to build this node. We don't want to be appending great grand parents.

Parameters:
parent - the group to which this will belong.
data - DOCUMENT ME!
lengthIncluded - DOCUMENT ME!

CodatBinaryID

public CodatBinaryID(PeerGroupID groupID,
                     InputStream in)

CodatBinaryID

public CodatBinaryID(PeerGroupID groupID,
                     byte[] seed,
                     InputStream in)
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.

getPeerGroupID

public ID getPeerGroupID()
Returns PeerGroupID of the Peer Group to which this Codat ID belongs.

Specified by:
getPeerGroupID in class CodatID
Returns:
PeerGroupID of the Peer Group which this ID is part of.

getID

protected String getID()
returns the coded ID without the binaryid tag.

Returns:
Returns the raw string used to create the urn!

isStatic

public boolean isStatic()
Returns true if this CodatID is associated with a static Codat. Binary ID only supports static

Specified by:
isStatic in class CodatID
Returns:
true if the codatId is for a Codat with static content otherwise false.

JXSE