JXTA

net.jxta.impl.id.UUID
Class ModuleSpecID

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

public class ModuleSpecID
extends ModuleSpecID

An implementation of the ModuleSpecID ID Type.

See Also:
Serialized Form

Field Summary
protected  IDBytes id
          The id data
 
Fields inherited from class net.jxta.id.ID
nullID, URIEncodingName, URNNamespace
 
Constructor Summary
protected ModuleSpecID()
          Constructor.
protected ModuleSpecID(IDBytes id)
          Initializes contents from provided ID.
  ModuleSpecID(ModuleClassID classID)
          See IDFactory.Instantiator.newModuleSpecID(net.jxta.platform.ModuleClassID).
protected ModuleSpecID(UUID classUUID, UUID specUUID)
          Creates a ModuleSpecID in a given class, with a given class unique id.
 
Method Summary
 boolean equals(Object target)
          
 ModuleClassID getBaseClass()
          Return a ModuleClassID of the same base class but with the role portion set to zero. aka "the base class".
protected  UUID getClassUUID()
          get the class' unique id
 String getIDFormat()
          Returns a string identifier which indicates which ID format is used by this ID instance.
protected  UUID getSpecUUID()
          get the spec unique id
 Object getUniqueValue()
          Returns an object containing the unique value of the ID.
 int hashCode()
          
 boolean isOfSameBaseClass(ModuleClassID classId)
          Returns true if this ModuleSpecID is of the same base class than the given class.
 boolean isOfSameBaseClass(ModuleSpecID specId)
          Returns true if this ModuleSpecID is of the same base class than the the given ModuleSpecID.
 
Methods inherited from class net.jxta.platform.ModuleSpecID
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 IDBytes id
The id data

Constructor Detail

ModuleSpecID

protected ModuleSpecID()
Constructor. Used only internally.


ModuleSpecID

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

Parameters:
id - the ID data

ModuleSpecID

protected ModuleSpecID(UUID classUUID,
                       UUID specUUID)
Creates a ModuleSpecID in a given class, with a given class unique id. A UUID of a class and another UUID are provided.

Parameters:
classUUID - the class to which this will belong.
specUUID - the unique id of this spec in that class.

ModuleSpecID

public ModuleSpecID(ModuleClassID classID)
See IDFactory.Instantiator.newModuleSpecID(net.jxta.platform.ModuleClassID).

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.

getBaseClass

public ModuleClassID getBaseClass()
Return a ModuleClassID of the same base class but with the role portion set to zero. aka "the base class".

Specified by:
getBaseClass in class ModuleSpecID
Returns:
ModuleClassID the base class.

isOfSameBaseClass

public boolean isOfSameBaseClass(ModuleClassID classId)
Returns true if this ModuleSpecID is of the same base class than the given class. Note: This method is NOT named "isOfClass" because a ModuleClassID may have two portions; one that denotes a class proper, and an optional second one that denotes a "Role". For convenience, we refer the class stripped of its role portion as "the base class" although this is not a totally accurate term. A ModuleSpecID, is of a base class but is not related to any kind of role. So using "isOfClass" could be misleading. Base classes are represented by a class with the role ID set to zero, which happens to be a valid class. This routine may be used for comparison with such a class, of course.

Specified by:
isOfSameBaseClass in class ModuleSpecID
Parameters:
classId - Module class id to compare with
Returns:
boolean true if equals

isOfSameBaseClass

public boolean isOfSameBaseClass(ModuleSpecID specId)
Returns true if this ModuleSpecID is of the same base class than the the given ModuleSpecID.

Specified by:
isOfSameBaseClass in class ModuleSpecID
Parameters:
specId - Module spec id to compare with
Returns:
boolean true if equals

getClassUUID

protected UUID getClassUUID()
get the class' unique id

Returns:
UUID module class' unique id
Since:
JXTA 1.0

getSpecUUID

protected UUID getSpecUUID()
get the spec unique id

Returns:
UUID module spec unique id
Since:
JXTA 1.0

JXSE