jChatBox.Chat
Class Msg

java.lang.Object
  |
  +--jChatBox.Chat.Msg
All Implemented Interfaces:
java.io.Serializable

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
See Also:
Constant Field Values

JOIN

public static final int JOIN
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

PRIVATE

public static final int PRIVATE
See Also:
Constant Field Values

KICK

public static final int KICK
See Also:
Constant Field Values

BAN

public static final int BAN
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

NORMAL

public static final int NORMAL
See Also:
Constant Field Values
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.