javax.slee
Class ComponentID

java.lang.Object
  extended by javax.slee.ComponentID
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
EventTypeID, LibraryID, ProfileSpecificationID, ResourceAdaptorID, ResourceAdaptorTypeID, SbbID, ServiceID

public abstract class ComponentID
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable, java.lang.Cloneable

The ComponentID class is the common base class for all component identifiers. All deployable components installed in the SLEE have some component identity, specified as a derivitive class of ComponentID.

See Also:
Serialized Form

Constructor Summary
protected ComponentID(java.lang.String name, java.lang.String vendor, java.lang.String version)
          Create a new component identifier.
 
Method Summary
abstract  int compareTo(java.lang.Object obj)
          Compare this component identifier with the specified object for order.
protected  int compareTo(java.lang.String thisClassName, ComponentID that)
          Compare this component identifier with the specified component identifier for order.
 boolean equals(java.lang.Object obj)
          Compare this component identifier for equality with another object.
protected abstract  java.lang.String getClassName()
          Get the class name of this component identifier.
 java.lang.String getName()
          Get the name of the component.
 java.lang.String getVendor()
          Get the vendor of the component.
 java.lang.String getVersion()
          Get the version of the component.
 int hashCode()
          Get a hash code value for this component identifier.
 java.lang.String toString()
          Get a string representation for this component identifier.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComponentID

protected ComponentID(java.lang.String name,
                      java.lang.String vendor,
                      java.lang.String version)
Create a new component identifier.

Parameters:
name - the name of the component.
vendor - the vendor of the component.
version - the version of the component.
Throws:
java.lang.NullPointerException - if any argument is null.
Method Detail

getName

public final java.lang.String getName()
Get the name of the component.

Returns:
the name of the component.

getVendor

public final java.lang.String getVendor()
Get the vendor of the component.

Returns:
the vendor of the component.

getVersion

public final java.lang.String getVersion()
Get the version of the component.

Returns:
the version of the component.

equals

public final boolean equals(java.lang.Object obj)
Compare this component identifier for equality with another object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this with.
Returns:
true if obj is a component identifier of the same class as this, and has the same name, vendor, and version as this, false otherwise.
See Also:
Object.equals(Object)

hashCode

public final int hashCode()
Get a hash code value for this component identifier.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this identifier.
See Also:
Object.hashCode()

toString

public final java.lang.String toString()
Get a string representation for this component identifier.

Overrides:
toString in class java.lang.Object
Returns:
a string representation for this component identifier.
See Also:
Object.toString()

compareTo

public abstract int compareTo(java.lang.Object obj)
Compare this component identifier with the specified object for order. Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.

Component ordering is determined by comparing the component identifier attributes in the following order:

  1. component type (nb. any subclass of ComponentID may be safely compared without causing a ClassCastException)
  2. component name
  3. component vendor
  4. component version

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the object to compare this with.
Returns:
a negative integer, zero, or a positive integer if this component identifier is considered less than, equal to, or greater than the specified object.
See Also:
Comparable.compareTo(Object)

compareTo

protected final int compareTo(java.lang.String thisClassName,
                              ComponentID that)
Compare this component identifier with the specified component identifier for order. Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.

Component ordering is determined by comparing the component identifier attributes in the following order:

  1. component type (nb. any subclass of ComponentID may be safely compared without causing a ClassCastException)
  2. component name
  3. component vendor
  4. component version

Parameters:
thisClassName - the class name of this component identifier.
that - the component identifier to compare this with.
Returns:
a negative integer, zero, or a positive integer if this component identifier is considered less than, equal to, or greater than the specified object.
See Also:
Comparable.compareTo(Object)

getClassName

protected abstract java.lang.String getClassName()
Get the class name of this component identifier. More efficient than getClass().getName().

Returns:
the class name of this component identifier.


Copyright © 2008. All Rights Reserved.