Class ChatWithAddress

  • All Implemented Interfaces:
    IMessage

    public class ChatWithAddress
    extends java.lang.Object
    implements IMessage
    • Field Summary

    • Constructor Summary

      Constructors 
      Constructor Description
      ChatWithAddress​(java.lang.String buffer)
      Constructor of the class, splits the string in an array
      ChatWithAddress​(java.lang.String to, java.lang.String info)
      Constructor of the class
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAddress()
      "getter" for the address
      java.lang.String getInfo()
      "getter" for the info of the message
      Command getType()
      "getter" for the type of the command
      void setAddress​(java.lang.String fromOrTo)
      "setter" for the address
      java.lang.String toString()
      the to String method, forms the message into a string, seperated by "|"
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ChatWithAddress

        public ChatWithAddress​(java.lang.String to,
                               java.lang.String info)
        Constructor of the class
        Parameters:
        to - - where the message will be send to
        info - - info of the message
      • ChatWithAddress

        public ChatWithAddress​(java.lang.String buffer)
        Constructor of the class, splits the string in an array
        Parameters:
        buffer - - string which splits
    • Method Detail

      • getAddress

        public java.lang.String getAddress()
        "getter" for the address
        Returns:
        - the adress
      • setAddress

        public void setAddress​(java.lang.String fromOrTo)
        "setter" for the address
        Parameters:
        fromOrTo - address of the client who sends or gets the message
      • getInfo

        public java.lang.String getInfo()
        "getter" for the info of the message
        Returns:
        - the info of the message
      • toString

        public java.lang.String toString()
        the to String method, forms the message into a string, seperated by "|"
        Overrides:
        toString in class java.lang.Object
        Returns:
        string which contains the command type, the address and the message info seperated by a "|"
      • getType

        public Command getType()
        "getter" for the type of the command
        Specified by:
        getType in interface IMessage
        Returns:
        the type of the command