Package pacManReloaded.common.messages
Class ChatWithAddress
- java.lang.Object
-
- pacManReloaded.common.messages.ChatWithAddress
-
-
Constructor Summary
Constructors Constructor Description ChatWithAddress(java.lang.String buffer)
Constructor of the class, splits the string in an arrayChatWithAddress(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 addressjava.lang.String
getInfo()
"getter" for the info of the messageCommand
getType()
"getter" for the type of the commandvoid
setAddress(java.lang.String fromOrTo)
"setter" for the addressjava.lang.String
toString()
the to String method, forms the message into a string, seperated by "|"
-
-
-
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 toinfo
- - 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 classjava.lang.Object
- Returns:
- string which contains the command type, the address and the message info seperated by a "|"
-
-