Class MessageCreator
Class MessageCreator
java.lang.Object
|
+----MessageCreator
- class MessageCreator
- extends Object
A class used in creating various specific Message objects.
It should be the only entrypoint in creating Messages !
Written: Radu Sion
Version: 0.26
Source: MessageCreator.java
- See Also:
- ClientMessageCreator, ServerMessageCreator, Message, MessageParser
-
create(int, int, int, int, int)
-
-
DataBytes(byte[])
- Creates a simple data Message initialized with a byte array.
-
DataString(String)
- Creates a simple data Message initialized with the ASCII
information from a String.
-
modifyDestination(Message, int, int)
- Creates a new Message modifying the destination (group & number) of a provided one.
-
modifySender(Message, int, int)
- Creates a new Message modifying the sender (group & number) of a provided one.
-
NOP()
- Creates a NOP (empty) Message that should be ignored.
-
OK()
-
Creates a OK Message.
modifySender
public static Message modifySender(Message mess,
int player,
int group)
- Creates a new Message modifying the sender (group & number) of a provided one.
No parameter checkings performed.
- Parameters:
- mess - Old Message
- player - New sender number to set in the created Message
- group - New sender group number to set in the created Message
- Returns:
- A new modified Message
modifyDestination
public static Message modifyDestination(Message mess,
int player,
int group)
- Creates a new Message modifying the destination (group & number) of a provided one.
- Parameters:
- mess - Old Message
- player - New destination number to set in the created Message
- group - New destination group number to set in the created Message
- Returns:
- A new modified Message
DataString
public static Message DataString(String say)
- Creates a simple data Message initialized with the ASCII
information from a String.
- Returns:
- The created Message
DataBytes
public static Message DataBytes(byte say[])
- Creates a simple data Message initialized with a byte array.
- Returns:
- The created Message
create
protected static Message create(int type,
int sender,
int sender_group,
int dest,
int dest_group)
NOP
public static Message NOP()
- Creates a NOP (empty) Message that should be ignored. (generally speaking)
OK
public static Message OK()
- Creates a OK Message.
On receiving a OK from the server, the client should check again it's
group & number with the one of the OK