Class AbstractID
- java.lang.Object
-
- org.jcsp.net.AbstractID
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ApplicationID,DomainID,GlobalID,NodeID
public abstract class AbstractID extends java.lang.Object implements java.io.SerializableThis is an abstract class that is sub-classed by classes whose instances should represent some kind of identifier and be part of a hierarchy of
AbstractIDobjects.This class has no public or protected constructor so it may not be sub-classed by JCSP users. JCSP.NET defines four implementations of this class;
,ApplicationID,NodeIDandDomainID.GlobalIDAn
ApplicationIDobject identifies a JCSP application. A JCSP Application is formed of a process network initiated at a particular Node, but processes launched on a remote Node may also be part of the same application. The parentAbstractIDApplicationID objects areNodeIDobjects.A
NodeIDobject identifies a particular JCSP Node. A JCSP Node is a Java Virtual Machine that has been initialized to form part of a JCSP.NET network. The parentAbstractIDNodeID objects areDomainIDobjects.A
DomainIDobject represents a domain of JCSP Nodes. Node Domains are not presently implemented but this class is included for completeness. In the future, it is envisaged that domain controllers will be introduced. At present, allNodeIDobjects have a parentDomainIDequal to the Null Domain (this has a zero length string name).A
GlobalIDobject represents the global Node domain. This includes all domains, their sub-domains, and all Nodes within sub-domains. There only ever needs to be a single instance of this class. The parent of the Null Domain is aGlobalIDobject.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractID()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract AbstractIDgetParentID()Returns this instance's parentAbstractIDobject.(package private) abstract booleanonSameBranch(AbstractID abstractID)This tests whether another ID is on the same branch of a hierachy.
-
-
-
Method Detail
-
getParentID
public abstract AbstractID getParentID()
Returns this instance's parentAbstractIDobject.- Returns:
- the parent
AbstractIDof this object.
-
onSameBranch
abstract boolean onSameBranch(AbstractID 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.- Returns:
- a
booleanindicating whether or not the supplied object is on the same branch.
-
-