Package org.jcsp.net
Class DomainID
- java.lang.Object
-
- org.jcsp.net.AbstractID
-
- org.jcsp.net.DomainID
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable
public final class DomainID extends AbstractID implements java.io.Serializable, java.lang.Comparable
A Class whose instances represent a unique identifier for a JCSP.NET domain.
See
AbstractIDfor a further explanation of domains and the use of this class.- Author:
- Quickstone Technologies Limited
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DomainID(java.lang.String name)Public constructor for aDomainIDwhich takes the name of the domain as a parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object o)Compares this object with another object and returns whether the supplied object is equals, smaller or larger.booleanequals(java.lang.Object o)This compares an object with this object.java.lang.StringgetDomainName()Public accessor for the Domain name.AbstractIDgetParentID()Returns the identifier representing this domain's parent domain.inthashCode()Returns aninthash code for the current object.java.lang.StringtoString()Returns a human readableStringshowing this domain name and any parent domains.
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
This compares an object with this object.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- an object to compare with this object.- Returns:
trueiff the supplied object is a non-nullDomainIDwhich represents the same Domain.
-
hashCode
public int hashCode()
Returns an
inthash code for the current object.This obeys the standard hash code rules.
- Overrides:
hashCodein classjava.lang.Object- Returns:
- an
inthash code.
-
compareTo
public int compareTo(java.lang.Object o)
Compares this object with another object and returns whether the supplied object is equals, smaller or larger.
- Specified by:
compareToin interfacejava.lang.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 java.lang.String getDomainName()
Public accessor for the Domain name.
Returns "" if this represents the Null Domain.
- Returns:
- the domain name as a
String.
-
toString
public java.lang.String toString()
Returns a human readable
Stringshowing this domain name and any parent domains.- Overrides:
toStringin classjava.lang.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:
getParentIDin classAbstractID- Returns:
- the parent
AbstractID.
-
-