Package org.jcsp.net
Class ApplicationID
- java.lang.Object
-
- org.jcsp.net.AbstractID
-
- org.jcsp.net.ApplicationID
-
- All Implemented Interfaces:
java.io.Serializable
public class ApplicationID extends AbstractID implements java.io.Serializable
A Class whose instances represent a unique identifier for a JCSP.NET application. An application is defined as being a process network that forms a complete program. Applications have a parent Node which is the Node on which the application was started.
For a full explanation, see
.AbstractID- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ApplicationID(NodeID nodeID, int appID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Compares the suppliedObjectwith thisApplicationID.AbstractIDgetParentID()Returns the parentNodeIDof this object.inthashCode()Returns a hash code for this Object.(package private) booleanonSameBranch(AbstractID abstractID)This tests whether another ID is on the same branch of a hierachy.java.lang.StringtoString()Returns aStringrepresentation of this object.
-
-
-
Field Detail
-
nodeID
private NodeID nodeID
-
appID
private int appID
-
-
Constructor Detail
-
ApplicationID
ApplicationID(NodeID nodeID, int appID)
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a
Stringrepresentation of this object. The current implemenation returns a human readableStringwhich shows the application's homeNodeIDand the integer application id.- Overrides:
toStringin classjava.lang.Object- Returns:
- the
Stringrepresenting this Application ID.
-
equals
public boolean equals(java.lang.Object o)
Compares the supplied
Objectwith thisApplicationID.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- anotherObjectto compare with thisApplicationID.- Returns:
trueiff the parameter o is anApplicationIDthat represents the same application as this object.
-
hashCode
public int hashCode()
Returns a hash code for this Object. Two equal
ApplicationIDobjects return the same hash code.- Overrides:
hashCodein classjava.lang.Object- Returns:
- an
inthash code.
-
onSameBranch
boolean onSameBranch(AbstractID abstractID)
Description copied from class:AbstractIDThis 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:
onSameBranchin classAbstractID- Returns:
- a
booleanindicating whether or not the supplied object is on the same branch.
-
getParentID
public AbstractID getParentID()
Returns the parentNodeIDof this object.- Specified by:
getParentIDin classAbstractID- Returns:
- the parent
NodeID.
-
-