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.

Variable Index

 o ADD_USER
 o ARE_YOU_THERE
 o ASK_MASTER
 o CHAT_DIALOG_STRING
 o CHAT_PERSONAL_STRING
 o CLASS_CODE
 o COM_CLASS
 o CONNECT_TO_EXISTING_COM
 o GET_USER_INFO
 o INVITATION
 o KICK_USER
 o LINE_DROPPED
 o LOAD_CLASS
 o MAKE_SOCKET
 o NEW_MASTER
 o NEW_TOPIC
 o NEW_USER_INFO
 o NOT_ALLOWED
 o NO_CONNECTION
 o NO_DATA
 o OK
 o PING
 o PRIVATE_DATA
 o UPCOMING_USER
 o USER_LEFT
 o WHO_AM_I
 o WHO_ELSE
 o WINDOW_MOVED
 o arg
 o from
 o priority
Message Priority: 0 = highest Priority
 o to
 o type

Constructor Index

 o Msg(int, int, int, Object)
Contructor for a message.
 o Msg(int, int, int, int, Object)
Contructor for a message.
 o Msg(int, int, Object)
Contructor for a message.
 o Msg(int, Object)
Contructor for a message.
 o Msg(int)
Contructor for a message.

Method Index

 o isAnswer()
Checks if the current msg is an answer-message.
 o setAnswer(boolean)
Make the msg to an answer or non-answer-message.
 o toString()
Returns a String object representing this message.

Variables

 o NOT_ALLOWED
  public final static int NOT_ALLOWED
 o NO_CONNECTION
  public final static int NO_CONNECTION
 o OK
  public final static int OK
 o WHO_AM_I
  public final static int WHO_AM_I
 o WHO_ELSE
  public final static int WHO_ELSE
 o COM_CLASS
  public final static int COM_CLASS
 o CONNECT_TO_EXISTING_COM
  public final static int CONNECT_TO_EXISTING_COM
 o INVITATION
  public final static int INVITATION
 o MAKE_SOCKET
  public final static int MAKE_SOCKET
 o LOAD_CLASS
  public final static int LOAD_CLASS
 o LINE_DROPPED
  public final static int LINE_DROPPED
 o NO_DATA
  public final static int NO_DATA
 o PRIVATE_DATA
  public final static int PRIVATE_DATA
 o ARE_YOU_THERE
  public final static int ARE_YOU_THERE
 o CLASS_CODE
  public final static int CLASS_CODE
 o PING
  public final static int PING
 o GET_USER_INFO
  public final static int GET_USER_INFO
 o ASK_MASTER
  public final static int ASK_MASTER
 o UPCOMING_USER
  public final static int UPCOMING_USER
 o NEW_TOPIC
  public final static int NEW_TOPIC
 o NEW_USER_INFO
  public final static int NEW_USER_INFO
 o NEW_MASTER
  public final static int NEW_MASTER
 o KICK_USER
  public final static int KICK_USER
 o USER_LEFT
  public final static int USER_LEFT
 o ADD_USER
  public final static int ADD_USER
 o WINDOW_MOVED
  public final static int WINDOW_MOVED
 o CHAT_DIALOG_STRING
  public final static int CHAT_DIALOG_STRING
 o CHAT_PERSONAL_STRING
  public final static int CHAT_PERSONAL_STRING
 o from
  public int from
 o to
  public int to
 o arg
  public Object arg
 o type
  public int type
 o priority
  public int priority
Message Priority: 0 = highest Priority

Constructors

 o 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)
 o 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).
 o 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).
 o 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).
 o Msg
  public Msg(int typ)
Contructor for a message.
Parameters:
typ - the type of the Message (e.g. NEW_USER_INFO)

Methods

 o isAnswer
  public boolean isAnswer()
Checks if the current msg is an answer-message.
Returns:
true if the message is an answer.
 o 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.
 o 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