org.globus.cog.abstraction.impl.common
Class IdentityImpl

java.lang.Object
  extended byorg.globus.cog.abstraction.impl.common.IdentityImpl
All Implemented Interfaces:
Identity

public class IdentityImpl
extends Object
implements Identity

An implementation of the Identity interface. It calculates a unique value for this Identityby assigning it the value of a static counter that was initialized by the current time of day in milliseconds.


Constructor Summary
IdentityImpl()
          The default constructor.
IdentityImpl(Identity identity)
          Makes a shallow copy of the given Identity.
IdentityImpl(String namespace)
          Instantiates an Identity with the given namespace.
 
Method Summary
 boolean equals(Identity id)
          Compares this with any other Identity.
 boolean equals(Object object)
           
 String getNameSpace()
          Returns the namespace for this Identity.
 long getValue()
          Returns the value for this Identity.
 int hashCode()
           
 void setNameSpace(String namespace)
          Sets the namespace for this Identity.
 void setValue(long value)
          Sets the value for this Identity.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdentityImpl

public IdentityImpl()
The default constructor. Assigns a default namespace to this identity as cog.


IdentityImpl

public IdentityImpl(String namespace)
Instantiates an Identity with the given namespace.


IdentityImpl

public IdentityImpl(Identity identity)
Makes a shallow copy of the given Identity. Instantiates an Identity by copying the namespace and value from the given Identity.

Method Detail

setNameSpace

public void setNameSpace(String namespace)
Description copied from interface: Identity
Sets the namespace for this Identity.

Specified by:
setNameSpace in interface Identity
Parameters:
namespace - a string representing the namespace for this Identity.

getNameSpace

public String getNameSpace()
Description copied from interface: Identity
Returns the namespace for this Identity.

Specified by:
getNameSpace in interface Identity
Returns:
the namespace for this Identity

setValue

public void setValue(long value)
Description copied from interface: Identity
Sets the value for this Identity.

Specified by:
setValue in interface Identity
Parameters:
value - a numeric value representing the namespace for this Identity.

getValue

public long getValue()
Description copied from interface: Identity
Returns the value for this Identity.

Specified by:
getValue in interface Identity
Returns:
the value for this Identity

equals

public boolean equals(Identity id)
Description copied from interface: Identity
Compares this with any other Identity.

Specified by:
equals in interface Identity

equals

public boolean equals(Object object)

hashCode

public int hashCode()

toString

public String toString()