Package org.jcsp.net

Class 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int appID  
      private NodeID nodeID  
    • Constructor Summary

      Constructors 
      Constructor Description
      ApplicationID​(NodeID nodeID, int appID)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Compares the supplied Object with this ApplicationID.
      AbstractID getParentID()
      Returns the parent NodeID of this object.
      int hashCode()
      Returns a hash code for this Object.
      (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 String representation of this object.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 String representation of this object. The current implemenation returns a human readable String which shows the application's home NodeID and the integer application id.

        Overrides:
        toString in class java.lang.Object
        Returns:
        the String representing this Application ID.
      • equals

        public boolean equals​(java.lang.Object o)

        Compares the supplied Object with this ApplicationID.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - another Object to compare with this ApplicationID.
        Returns:
        true iff the parameter o is an ApplicationID that represents the same application as this object.
      • hashCode

        public int hashCode()

        Returns a hash code for this Object. Two equal ApplicationID objects return the same hash code.

        Overrides:
        hashCode in class java.lang.Object
        Returns:
        an int hash code.
      • 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 class AbstractID
        Returns:
        a boolean indicating whether or not the supplied object is on the same branch.
      • getParentID

        public AbstractID getParentID()
        Returns the parent NodeID of this object.
        Specified by:
        getParentID in class AbstractID
        Returns:
        the parent NodeID.