Class como.sys.Msg
All Packages Class Hierarchy This Package Previous Next Index
Class como.sys.Msg
java.lang.Object
|
+----como.sys.Msg
- public class Msg
- extends Object
This is used for sending messages over the net. A Msg can include an object
that implements Saveable.
Some classes are inherently supported (String, Integer, Dictionary)
Just like an Event, a Msg has a type (integer). For your own messages
you can pick any types > 10000. We strongly recommend increasing the
numbers the further you go down the Object hierarchy.
For messages, type should be >0. Right now, answers are implemented as
negative types. The answer is the inverse of the question.
-
ADD_USER
-
-
ARE_YOU_THERE
-
-
ASK_MASTER
-
-
CHAT_DIALOG_STRING
-
-
CHAT_PERSONAL_STRING
-
-
CLASS_CODE
-
-
COM_CLASS
-
-
CONNECT_TO_EXISTING_COM
-
-
GET_USER_INFO
-
-
INVITATION
-
-
KICK_USER
-
-
LINE_DROPPED
-
-
LOAD_CLASS
-
-
MAKE_SOCKET
-
-
NEW_MASTER
-
-
NEW_TOPIC
-
-
NEW_USER_INFO
-
-
NOT_ALLOWED
-
-
NO_CONNECTION
-
-
NO_DATA
-
-
OK
-
-
PING
-
-
PRIVATE_DATA
-
-
UPCOMING_USER
-
-
USER_LEFT
-
-
WHO_AM_I
-
-
WHO_ELSE
-
-
WINDOW_MOVED
-
-
arg
-
-
from
-
-
priority
- Message Priority: 0 = highest Priority
-
to
-
-
type
-
-
Msg(int, int, int, Object)
- Contructor for a message.
-
Msg(int, int, int, int, Object)
- Contructor for a message.
-
Msg(int, int, Object)
- Contructor for a message.
-
Msg(int, Object)
- Contructor for a message.
-
Msg(int)
- Contructor for a message.
-
isAnswer()
- Checks if the current msg is an answer-message.
-
setAnswer(boolean)
- Make the msg to an answer or non-answer-message.
-
toString()
- Returns a String object representing this message.
NOT_ALLOWED
public final static int NOT_ALLOWED
NO_CONNECTION
public final static int NO_CONNECTION
OK
public final static int OK
WHO_AM_I
public final static int WHO_AM_I
WHO_ELSE
public final static int WHO_ELSE
COM_CLASS
public final static int COM_CLASS
CONNECT_TO_EXISTING_COM
public final static int CONNECT_TO_EXISTING_COM
INVITATION
public final static int INVITATION
MAKE_SOCKET
public final static int MAKE_SOCKET
LOAD_CLASS
public final static int LOAD_CLASS
LINE_DROPPED
public final static int LINE_DROPPED
NO_DATA
public final static int NO_DATA
PRIVATE_DATA
public final static int PRIVATE_DATA
ARE_YOU_THERE
public final static int ARE_YOU_THERE
CLASS_CODE
public final static int CLASS_CODE
PING
public final static int PING
GET_USER_INFO
public final static int GET_USER_INFO
ASK_MASTER
public final static int ASK_MASTER
UPCOMING_USER
public final static int UPCOMING_USER
NEW_TOPIC
public final static int NEW_TOPIC
NEW_USER_INFO
public final static int NEW_USER_INFO
NEW_MASTER
public final static int NEW_MASTER
KICK_USER
public final static int KICK_USER
USER_LEFT
public final static int USER_LEFT
ADD_USER
public final static int ADD_USER
WINDOW_MOVED
public final static int WINDOW_MOVED
CHAT_DIALOG_STRING
public final static int CHAT_DIALOG_STRING
CHAT_PERSONAL_STRING
public final static int CHAT_PERSONAL_STRING
from
public int from
to
public int to
arg
public Object arg
type
public int type
priority
public int priority
- Message Priority: 0 = highest Priority
Msg
public Msg(int typ,
int f,
int t,
Object o)
- Contructor for a message.
- Parameters:
- typ - the type of the Message (e.g. NEW_USER_INFO)
- f - the sender's ID
- t - the ID you want to send the message to.
- o - the Object you want to send (must implement Saveable or be support java.lang-Object)
Msg
public Msg(int typ,
int f,
int t,
int p,
Object c)
- Contructor for a message.
- Parameters:
- typ - the type of the Message (e.g. NEW_USER_INFO)
- f - the sender's ID
- t - the ID you want to send the message to.
- p - the message's priority (0 highest).
- o - the Object you want to send (must implement Saveable or
must be supported by como.io.ObjectXXXStream).
Msg
public Msg(int type,
int to,
Object arg)
- Contructor for a message. The sender's ID is not set,
but is usually set by the ComObj automatically.
- Parameters:
- typ - the type of the Message (e.g. NEW_USER_INFO)
- t - the ID you want to send the message to.
- o - the Object you want to send (must implement Saveable or
must be supported by como.io.ObjectXXXStream).
Msg
public Msg(int typ,
Object c)
- Contructor for a message.
- Parameters:
- typ - the type of the Message (e.g. NEW_USER_INFO)
- o - the Object you want to send (must implement Saveable or
must be supported by como.io.ObjectXXXStream).
Msg
public Msg(int typ)
- Contructor for a message.
- Parameters:
- typ - the type of the Message (e.g. NEW_USER_INFO)
isAnswer
public boolean isAnswer()
- Checks if the current msg is an answer-message.
- Returns:
- true if the message is an answer.
setAnswer
public void setAnswer(boolean isanswer)
- Make the msg to an answer or non-answer-message.
- Parameters:
- isanswer - set to true, if you want to make an answer.
toString
public String toString()
- Returns a String object representing this message.
- Returns:
- the String.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index