Package org.jcsp.net

Class ChannelID

  • All Implemented Interfaces:
    java.io.Serializable

    class ChannelID
    extends java.lang.Object
    implements java.io.Serializable
    • Constructor Summary

      Constructors 
      Constructor Description
      ChannelID​(java.lang.String stringForm)  
      ChannelID​(NodeID nodeID, long index)
      Creates a ChannelID for a channel.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static ChannelID createFromStringForm​(java.lang.String stringForm)
      This returns a ChannelID created from its String form as returned by the getStringForm method.
      boolean equals​(java.lang.Object obj)
      Compares two ChannelIDs for equality.
      long getIndex()
      Returns the channel's index number.
      NodeID getNodeID()
      Returns the channel's NodeID.
      (package private) java.lang.String getStringForm()
      This returns a String representation of this ChannelID.
      java.lang.String toString()
      Returns a human readable string representation of the current instance of this class.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • nodeID

        private NodeID nodeID
      • index

        private long index
      • STRING_FORM_PREFIX

        private static final java.lang.String STRING_FORM_PREFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • ChannelID

        public ChannelID​(NodeID nodeID,
                         long index)
        Creates a ChannelID for a channel.
        Parameters:
        nodeID - The host node.
        index - the channel index.
      • ChannelID

        ChannelID​(java.lang.String stringForm)
           throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
    • Method Detail

      • createFromStringForm

        static ChannelID createFromStringForm​(java.lang.String stringForm)
                                       throws java.lang.IllegalArgumentException
        This returns a ChannelID created from its String form as returned by the getStringForm method.
        Parameters:
        stringForm - the String to use to create the ChannelID.
        Returns:
        the recreated ChannelID.
        Throws:
        java.lang.IllegalArgumentException
      • getStringForm

        java.lang.String getStringForm()
        This returns a String representation of this ChannelID. The ChannelID can be recreated by calling the createFromString method.
        Returns:
        the String representing this ChannelID.
      • getNodeID

        public final NodeID getNodeID()
        Returns the channel's NodeID.
        Returns:
        the channel's NodeID.
      • getIndex

        public final long getIndex()
        Returns the channel's index number.
        Returns:
        the channel's index number.
      • equals

        public final boolean equals​(java.lang.Object obj)
        Compares two ChannelIDs for equality.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - Another Object to compare with this Object.
        Returns:
        true iff obj is a non-null ChannelID which represents the same channel.
      • toString

        public java.lang.String toString()
        Returns a human readable string representation of the current instance of this class.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a human readable String object.