jChatBox.Chat
Class Msg

java.lang.Object
  |
  +--jChatBox.Chat.Msg

public class Msg
extends java.lang.Object
implements java.io.Serializable

This class implements Message features.
A message has :
From field (user's name of the sender).
To field (user's name of the receiver or all or broadcast).
Date field (date of the message).
Msg field (message content).
Type field (message type).

See Also:
Serialized Form

Field Summary
static int BAN
           
static int JOIN
           
static int KICK
           
static int LEFT
           
static int NORMAL
           
static int PRIVATE
           
static int SYSTEM
           
static int WARNING
           
 
Constructor Summary
Msg(java.util.Date date, java.lang.String from, java.lang.String to, java.lang.String mesg)
          Constructs NORMAL message.
Msg(java.util.Date date, java.lang.String from, java.lang.String to, java.lang.String mesg, int type)
          Constructs message.
 
Method Summary
 java.util.Date getDate()
          Returns message's date.
 java.lang.String getFrom()
          Returns "From" field.
 java.lang.String getMsg()
          Returns "Message".
 java.lang.String getTo()
          Returns "To" field.
 int getType()
          Returns "Type" field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSTEM

public static final int SYSTEM

JOIN

public static final int JOIN

LEFT

public static final int LEFT

PRIVATE

public static final int PRIVATE

KICK

public static final int KICK

BAN

public static final int BAN

WARNING

public static final int WARNING

NORMAL

public static final int NORMAL
Constructor Detail

Msg

public Msg(java.util.Date date,
           java.lang.String from,
           java.lang.String to,
           java.lang.String mesg)
Constructs NORMAL message.

Msg

public Msg(java.util.Date date,
           java.lang.String from,
           java.lang.String to,
           java.lang.String mesg,
           int type)
Constructs message.
Method Detail

getDate

public java.util.Date getDate()
Returns message's date.

getFrom

public java.lang.String getFrom()
Returns "From" field.

getMsg

public java.lang.String getMsg()
Returns "Message".

getTo

public java.lang.String getTo()
Returns "To" field.

getType

public int getType()
Returns "Type" field.