Project JXTA

net.jxta.peer
Class PeerID

java.lang.Object
  |
  +--net.jxta.id.ID
        |
        +--net.jxta.peer.PeerID

public class PeerID
extends ID
implements java.lang.Cloneable

This class implements a PeerID. Each peer is assigned a unique peer id.UUID id are used to implement peer id.

Since:
JXTA 1.0
See Also:
ID, IDFactory, net.jxta.id.UUID, net.jxta.id.UUIDFactory, PeerGroupID

Fields inherited from class net.jxta.id.ID
bytes, flagCodatID, flagNullID, flagPeerGroupID, flagPeerID, flagPipeID, flagsEncodingOffset, flagsIdTypeOffset, flagsOffset, flagsSize, IdByteArraySize, nullID, URIEncodingName, UUIDEncoded
 
Constructor Summary
PeerID()
          Constructor used in the creation of PeerIDs from URIs.
PeerID(PeerGroupID groupID)
          Constructor.
 
Method Summary
 java.lang.Object clone()
          Clones this PeerID
 boolean equals(java.lang.Object id)
          Returns true if the two PeerIDs are same
 PeerGroupID getPeerGroupID()
          Returns the PeerGroupID of the PeerGroup associated with this Peer
 
Methods inherited from class net.jxta.id.ID
bytesIntoLong, getURL, hashCode, isSamePeerGroup, longIntoBytes, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PeerID

public PeerID()
Constructor used in the creation of PeerIDs from URIs. Other than that there is no reason to use this constructor.
Since:
JXTA 1.0

PeerID

public PeerID(PeerGroupID groupID)
Constructor. Creates a PeerID. A PeerGroupID is provided
Parameters:
groupID - the group to which this will belong.
Since:
JXTA 1.0
Method Detail

getPeerGroupID

public PeerGroupID getPeerGroupID()
Returns the PeerGroupID of the PeerGroup associated with this Peer
Overrides:
getPeerGroupID in class ID
Returns:
PeerGroupID return peer group Id
Since:
JXTA 1.0

equals

public boolean equals(java.lang.Object id)
Returns true if the two PeerIDs are same
Overrides:
equals in class ID
Parameters:
ip - peerid to compare
Returns:
boolean true if equals
Since:
JXTA 1.0

clone

public java.lang.Object clone()
Clones this PeerID
Overrides:
clone in class ID
Returns:
Object Cloned peer id.
Since:
JXTA 1.0

Project JXTA