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
AbstractID
for a further explanation of domains and the use of this class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DomainStringFormPrefix
private java.lang.String
name
private boolean
nullDom
private static java.lang.String
NullDomainStringForm
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compareTo(java.lang.Object o)
Compares this object with another object and returns whether the supplied object is equals, smaller or larger.(package private) static DomainID
createFromStringForm(java.lang.String str)
Deprecated.not needed now channel names abstractedboolean
equals(java.lang.Object o)
This compares an object with this object.java.lang.String
getDomainName()
Public accessor for the Domain name.(package private) static DomainID
getNullDomainID()
AbstractID
getParentID()
Returns the identifier representing this domain's parent domain.(package private) java.lang.String
getStringForm()
Deprecated.not needed now channel names abstractedint
hashCode()
Returns anint
hash code for the current object.(package private) boolean
isNullDomain()
(package private) boolean
onSameBranch(AbstractID abstractID)
This tests whether another ID is on the same branch of a hierachy.java.lang.String
toString()
Returns a human readableString
showing this domain name and any parent domains.
-
-
-
Field Detail
-
nullDom
private boolean nullDom
-
name
private java.lang.String name
-
NullDomainStringForm
private static final java.lang.String NullDomainStringForm
- See Also:
- Constant Field Values
-
DomainStringFormPrefix
private static final java.lang.String DomainStringFormPrefix
- See Also:
- Constant Field Values
-
-
Method Detail
-
createFromStringForm
static DomainID createFromStringForm(java.lang.String str) throws java.lang.IllegalArgumentException
Deprecated.not needed now channel names abstracted- Throws:
java.lang.IllegalArgumentException
-
equals
public boolean equals(java.lang.Object o)
This compares an object with this object.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- an object to compare with this object.- Returns:
true
iff the supplied object is a non-nullDomainID
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 classjava.lang.Object
- Returns:
- an
int
hash 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:
compareTo
in 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.
-
onSameBranch
boolean onSameBranch(AbstractID abstractID)
Description copied from class:AbstractID
This tests whether another ID is on the same branch of a hierachy. Returns true if either the supplied object is a child (or a child of child etc.) of this object or if the supplied object is a parent (or a parent of a parent etc.) of this object.- Specified by:
onSameBranch
in classAbstractID
- Returns:
- a
boolean
indicating whether or not the supplied object is on the same branch.
-
isNullDomain
boolean isNullDomain()
-
getNullDomainID
static DomainID getNullDomainID()
-
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
String
showing this domain name and any parent domains.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the human readable
String
.
-
getStringForm
java.lang.String getStringForm()
Deprecated.not needed now channel names abstracted
-
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 classAbstractID
- Returns:
- the parent
AbstractID
.
-
-