JXTA

net.jxta.impl.id.UUID
Class PeerGroupID

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

public class PeerGroupID
extends PeerGroupID

An implementation of the PeerGroupID ID Type.

See Also:
Serialized Form

Field Summary
protected static int groupIdOffset
          Location of the group id UUID within the id bytes.
protected  IDBytes id
          The id data
protected static int padOffset
          Location of the begining of the pad space.
protected static int padSize
          size of the pad space.
protected static int parentgroupIdOffset
          Location of the parent group id UUID within the id bytes.
 
Fields inherited from class net.jxta.peergroup.PeerGroupID
defaultNetPeerGroupID, worldPeerGroupID
 
Fields inherited from class net.jxta.id.ID
nullID, URIEncodingName, URNNamespace
 
Constructor Summary
  PeerGroupID()
          See IDFactory.Instantiator.newPeerGroupID().
  PeerGroupID(byte[] seed)
          See IDFactory.Instantiator.newPeerGroupID(byte[]).
protected PeerGroupID(IDBytes id)
          Initializes contents from provided ID.
  PeerGroupID(PeerGroupID parent)
          See IDFactory.Instantiator.newPeerGroupID(net.jxta.peergroup.PeerGroupID).
  PeerGroupID(PeerGroupID parent, byte[] seed)
          See IDFactory.Instantiator.newPeerGroupID(net.jxta.peergroup.PeerGroupID,byte[]).
protected PeerGroupID(UUID groupUUID)
          Creates a PeerGroupID.
 
Method Summary
 boolean equals(Object target)
          
 String getIDFormat()
          Returns a string identifier which indicates which ID format is used by this ID instance.
 PeerGroupID getParentPeerGroupID()
          Returns the parent peer group id of this peer group id, if any.
 Object getUniqueValue()
          Returns an object containing the unique value of the ID.
protected  UUID getUUID()
          Returns the UUID associated with this PeerGroupID.
 int hashCode()
          
 
Methods inherited from class net.jxta.peergroup.PeerGroupID
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
Location of the group id UUID within the id bytes.

See Also:
Constant Field Values

parentgroupIdOffset

protected static final int parentgroupIdOffset
Location of the parent group id UUID within the id bytes.

See Also:
Constant Field Values

padOffset

protected static final int padOffset
Location of the begining of the pad space.

See Also:
Constant Field Values

padSize

protected static final int padSize
size of the pad space.

See Also:
Constant Field Values

id

protected IDBytes id
The id data

Constructor Detail

PeerGroupID

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

Parameters:
id - the ID data

PeerGroupID

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

Parameters:
groupUUID - the PeerGroupID to use to construct the new PeerGroupID

PeerGroupID

public PeerGroupID()
See IDFactory.Instantiator.newPeerGroupID().


PeerGroupID

public PeerGroupID(PeerGroupID parent)
See IDFactory.Instantiator.newPeerGroupID(net.jxta.peergroup.PeerGroupID).


PeerGroupID

public PeerGroupID(byte[] seed)
See IDFactory.Instantiator.newPeerGroupID(byte[]).


PeerGroupID

public PeerGroupID(PeerGroupID parent,
                   byte[] seed)
See IDFactory.Instantiator.newPeerGroupID(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.

getParentPeerGroupID

public PeerGroupID getParentPeerGroupID()
Returns the parent peer group id of this peer group id, if any.

Specified by:
getParentPeerGroupID in class PeerGroupID
Returns:
the id of the parent peergroup or null if this group has no parent group.

getUUID

protected UUID getUUID()
Returns the UUID associated with this PeerGroupID.

Returns:
The UUID associated with this PeerGroupID.

JXSE