JXTA

net.jxta.impl.id.UUID
Class PeerID

java.lang.Object
  extended by net.jxta.id.ID
      extended by net.jxta.peer.PeerID
          extended by net.jxta.impl.id.UUID.PeerID
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PeerID

public class PeerID
extends PeerID

An implementation of the PeerID ID Type.

See Also:
Serialized Form

Field Summary
protected static int groupIdOffset
           
protected  IDBytes id
          The id data
protected static int idOffset
           
protected static int padOffset
           
protected static int padSize
           
 
Fields inherited from class net.jxta.id.ID
nullID, URIEncodingName, URNNamespace
 
Constructor Summary
protected PeerID()
          Used only internally.
protected PeerID(IDBytes id)
          Initializes contents from provided ID.
  PeerID(PeerGroupID groupID)
          See IDFactory.Instantiator.newPeerID(net.jxta.peergroup.PeerGroupID).
  PeerID(PeerGroupID groupID, byte[] seed)
          See IDFactory.Instantiator.newPeerID(net.jxta.peergroup.PeerGroupID,byte[]).
protected PeerID(UUID groupUUID, UUID idUUID)
          Creates a PeerID.
 
Method Summary
 boolean equals(Object target)
          
 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 Peer ID belongs.
 Object getUniqueValue()
          Returns an object containing the unique value of the ID.
 int hashCode()
          
 
Methods inherited from class net.jxta.peer.PeerID
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

groupIdOffset

protected static final int groupIdOffset
See Also:
Constant Field Values

idOffset

protected static final int idOffset
See Also:
Constant Field Values

padOffset

protected static final int padOffset
See Also:
Constant Field Values

padSize

protected static final int padSize
See Also:
Constant Field Values

id

protected IDBytes id
The id data

Constructor Detail

PeerID

protected PeerID()
Used only internally.


PeerID

protected PeerID(IDBytes id)
Initializes contents from provided ID.

Parameters:
id - the ID data

PeerID

protected PeerID(UUID groupUUID,
                 UUID idUUID)
Creates a PeerID. A PeerGroupID is provided

Parameters:
groupUUID - the UUID of the group to which this will belong.
idUUID - the UUID which will be used for this pipe.

PeerID

public PeerID(PeerGroupID groupID)
See IDFactory.Instantiator.newPeerID(net.jxta.peergroup.PeerGroupID).


PeerID

public PeerID(PeerGroupID groupID,
              byte[] seed)
See IDFactory.Instantiator.newPeerID(net.jxta.peergroup.PeerGroupID,byte[]).

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 Peer ID belongs.

Specified by:
getPeerGroupID in class PeerID
Returns:
PeerGroupID of the Peer Group to which this Peer ID belongs.

JXSE