mstar
Class Chatter

java.lang.Object
  |
  +--mstar.Chatter

public class Chatter
extends java.lang.Object

The Chatter class represents output from the collaborative environment, from either other characters in the environment, the envrionment itself, or the character who executed a command. This class is used to hold the parsed data. In addition a higher level view of the command that caused the data to occur is also provided.

Version:
1.6
Author:
Thaddeus O. Cooper (cooper@tweenproject.org)
See Also:
Connection, ChatterFilter

Field Summary
static int ARRIVES
          The source of the chatter is from a character arriving in the room.
static int EMOTES
          The source of the chatter is from an emote command.
static int GIVES_OBJECT
          The source of the chatter is from a give command.
static int LEAVES
          The source of the chatter is from a character leaving the room.
static int MUTTERS
          The source of the chatter is from a mutters command.
static int MY_ACTION
          The source of the chatter is from a command executed by the character that this class is storing MUD chatter for.
static int PAGED_TO
          The source of the chatter is from a page command where the character that this class is storing MUD chatter for has been paged to another room.
static int PAGES
          The source of the chatter is from a page command.
static int POSES
          The source of the chatter is from a character executing a pose pose command.
static int SAYS
          The source of the chatter is from a say command.
static int UNDEFINED
          The source of the chatter is from an undefined command.
static int WHISPERS
          The source of the chatter is from a whisper command.
 
Constructor Summary
Chatter()
          Constructs a chatter entry with how undefined, and who, what, and when set to null.
Chatter(java.util.GregorianCalendar when)
          Constructs a chatter entry with how undefined, and who, and what set to null, and when set to the specified time the command was executed.
Chatter(java.util.GregorianCalendar when, java.lang.String who)
          Constructs a chatter entry with how undefined, what set to null, who set to the character in the collaborative environment that executed the command, and when set to the specified time the command was executed.
Chatter(java.util.GregorianCalendar when, java.lang.String who, int how)
          Constructs a chatter entry with how undefined, what set to null, who set to the character in the collaborative environment that executed the command, and when set to the specified time the command was executed.
Chatter(java.util.GregorianCalendar when, java.lang.String who, int how, java.lang.String what)
          Constructs a chatter entry with how undefined, what set to either what the character said or did, who set to the character in the collaborative environment that executed the command, and when set to the specified time the command was executed.
 
Method Summary
 int getHow()
          Get the type of command that was executed.
 java.lang.String getWhat()
          Gets what the character said or did.
 java.util.GregorianCalendar getWhen()
          Gets the time when the chatter was captured.
 java.lang.String getWho()
          Gets who executed the command.
 void setHow(int how)
          Sets the type of command that was executed.
 void setWhat(java.lang.String what)
          Sets what the character said or did.
 void setWhen(java.util.GregorianCalendar when)
          Sets the time when the chatter was captured.
 void setWho(java.lang.String who)
          Sets who executed the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNDEFINED

public static final int UNDEFINED
The source of the chatter is from an undefined command.

SAYS

public static final int SAYS
The source of the chatter is from a say command.

WHISPERS

public static final int WHISPERS
The source of the chatter is from a whisper command.

PAGES

public static final int PAGES
The source of the chatter is from a page command.

MUTTERS

public static final int MUTTERS
The source of the chatter is from a mutters command.

ARRIVES

public static final int ARRIVES
The source of the chatter is from a character arriving in the room.

LEAVES

public static final int LEAVES
The source of the chatter is from a character leaving the room.

POSES

public static final int POSES
The source of the chatter is from a character executing a pose pose command.

GIVES_OBJECT

public static final int GIVES_OBJECT
The source of the chatter is from a give command.

MY_ACTION

public static final int MY_ACTION
The source of the chatter is from a command executed by the character that this class is storing MUD chatter for.

PAGED_TO

public static final int PAGED_TO
The source of the chatter is from a page command where the character that this class is storing MUD chatter for has been paged to another room.

EMOTES

public static final int EMOTES
The source of the chatter is from an emote command.
Constructor Detail

Chatter

public Chatter()
Constructs a chatter entry with how undefined, and who, what, and when set to null.

Chatter

public Chatter(java.util.GregorianCalendar when)
Constructs a chatter entry with how undefined, and who, and what set to null, and when set to the specified time the command was executed.
Parameters:
when - The time that the chatter occurred in the collaborative environment.

Chatter

public Chatter(java.util.GregorianCalendar when,
               java.lang.String who)
Constructs a chatter entry with how undefined, what set to null, who set to the character in the collaborative environment that executed the command, and when set to the specified time the command was executed.
Parameters:
when - The time that the chatter occurred in the collaborative environment.
who - The character in the collaborative environment that executed the command.

Chatter

public Chatter(java.util.GregorianCalendar when,
               java.lang.String who,
               int how)
Constructs a chatter entry with how undefined, what set to null, who set to the character in the collaborative environment that executed the command, and when set to the specified time the command was executed.
Parameters:
when - The time that the chatter occurred in the collaborative environment.
who - The character in the collaborative environment that executed the command.
how - The type of command that was executed. This can be set to any of the fields including: UNDEFINED, SAYS, WHISPERS, PAGES, MUTTERS, ARRIVES, LEAVES, POSES, GIVES_OBJECT, MY_ACTION, PAGED_TO or EMOTES.

Chatter

public Chatter(java.util.GregorianCalendar when,
               java.lang.String who,
               int how,
               java.lang.String what)
Constructs a chatter entry with how undefined, what set to either what the character said or did, who set to the character in the collaborative environment that executed the command, and when set to the specified time the command was executed.
Parameters:
when - The time that the chatter occurred in the collaborative environment.
who - The character in the collaborative environment that executed the command.
how - The type of command that was executed. This can be set to any of the fields including: UNDEFINED, SAYS, WHISPERS, PAGES, MUTTERS, ARRIVES, LEAVES, POSES, GIVES_OBJECT, MY_ACTION, PAGED_TO or EMOTES.
what - What the character said or did. For instance if the characters' name is foo and they executed the following command:

say hello

Who would be set to foo, what would be set to hello, how would be set to SAYS, and when would be set to the gregorian calendar with the time the chatter was captured.

Method Detail

setWhen

public void setWhen(java.util.GregorianCalendar when)
Sets the time when the chatter was captured.
Parameters:
when - The time that the chatter was captured from the collaborative environment.

getWhen

public java.util.GregorianCalendar getWhen()
Gets the time when the chatter was captured.
Returns:
a GregorianCalendar with the time that the chatter was captured from the collaborative environment.

setHow

public void setHow(int how)
Sets the type of command that was executed. This can be set to any of the fields including: UNDEFINED, SAYS, WHISPERS, PAGES, MUTTERS, ARRIVES, LEAVES, POSES, GIVES_OBJECT, MY_ACTION, PAGED_TO or EMOTES.
Parameters:
how - The type of command that was executed. This can be set to any of the fields including: UNDEFINED, SAYS, WHISPERS, PAGES, MUTTERS, ARRIVES, LEAVES, POSES, GIVES_OBJECT, MY_ACTION, PAGED_TO or EMOTES.

getHow

public int getHow()
Get the type of command that was executed. This can be set to any of the fields including: UNDEFINED, SAYS, WHISPERS, PAGES, MUTTERS, ARRIVES, LEAVES, POSES, GIVES_OBJECT, MY_ACTION, PAGED_TO or EMOTES.
Returns:
The type of command that was executed. This can be set to any of the fields including: UNDEFINED, SAYS, WHISPERS, PAGES, MUTTERS, ARRIVES, LEAVES, POSES, GIVES_OBJECT, MY_ACTION, PAGED_TO or EMOTES.

setWhat

public void setWhat(java.lang.String what)
Sets what the character said or did.
Parameters:
what - What the character said or did. For instance if the characters' name is foo and they executed the following command:

say hello

Who would be set to foo, what would be set to hello, how would be set to SAYS, and when would be set to the gregorian calendar with the time the chatter was captured.


getWhat

public java.lang.String getWhat()
Gets what the character said or did.
Returns:
What the character said or did. For instance if the characters' name is foo and they executed the following command:

say hello

Who would be set to foo, what would be set to hello, how would be set to SAYS, and when would be set to the gregorian calendar with the time the chatter was captured.


setWho

public void setWho(java.lang.String who)
Sets who executed the command.
Parameters:
who - The character in the collaborative environment that executed the command.

getWho

public java.lang.String getWho()
Gets who executed the command.
Returns:
The character in the collaborative environment that executed the command.