CSP for Java
(JCSP) 1.1-rc4

org.jcsp.net
Class DomainID

java.lang.Object
  extended by org.jcsp.net.AbstractID
      extended by org.jcsp.net.DomainID
All Implemented Interfaces:
Serializable, Comparable

public final class DomainID
extends AbstractID
implements Serializable, Comparable

A Class whose instances represent a unique identifier for a JCSP.NET domain.

See AbstractID for a further explanation of domains and the use of this class.

Author:
Quickstone Technologies Limited
See Also:
Serialized Form

Constructor Summary
DomainID(String name)
          Public constructor for a DomainID which takes the name of the domain as a parameter.
 
Method Summary
 int compareTo(Object o)
           Compares this object with another object and returns whether the supplied object is equals, smaller or larger.
 boolean equals(Object o)
          This compares an object with this object.
 String getDomainName()
           Public accessor for the Domain name.
 AbstractID getParentID()
           Returns the identifier representing this domain's parent domain.
 int hashCode()
           Returns an int hash code for the current object.
 String toString()
           Returns a human readable String showing this domain name and any parent domains.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DomainID

public DomainID(String name)
Public constructor for a DomainID which takes the name of the domain as a parameter.

Parameters:
name - The name of the domain.
Method Detail

equals

public boolean equals(Object o)
This compares an object with this object.

Overrides:
equals in class Object
Parameters:
o - an object to compare with this object.
Returns:
true iff the supplied object is a non-null DomainID which represents the same Domain.

hashCode

public int hashCode()

Returns an int hash code for the current object.

This obeys the standard hash code rules.

Overrides:
hashCode in class Object
Returns:
an int hash code.

compareTo

public int compareTo(Object o)

Compares this object with another object and returns whether the supplied object is equals, smaller or larger.

Specified by:
compareTo in interface Comparable
Parameters:
o - The object to compare with this object.
Returns:
0 if the supplied object is equal, a negative integer if the supplied object is smaller or a positive integer if the other object is larger.

getDomainName

public String getDomainName()

Public accessor for the Domain name.

Returns "" if this represents the Null Domain.

Returns:
the domain name as a String.

toString

public String toString()

Returns a human readable String showing this domain name and any parent domains.

Overrides:
toString in class Object
Returns:
the human readable String.

getParentID

public AbstractID getParentID()

Returns the identifier representing this domain's parent domain.

At present this always returns the global domain's ID.

Specified by:
getParentID in class AbstractID
Returns:
the parent AbstractID.

CSP for Java
(JCSP) 1.1-rc4

Submit a bug or feature to jcsp-team@kent.ac.uk
Version 1.1-rc4 of the JCSP API Specification (Copyright 1997-2008 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.