edu.vt.marian.server
Class user_message_table

java.lang.Object
  |
  +--edu.vt.marian.server.user_message_table

public class user_message_table
extends java.lang.Object

class name: user_message_table class description: this class contains all the showable message to end users, put all these messages together will ease the implementing of language independentability. uses the services of class(es): designer(s): Jianxin Zhao (jxzhao@csgrad.cs.vt.edu) implementator(s): Ning Chai (nchai@csgrad.cs.vt.edu) finished time: Nov 30th, 1998 known bugs: JDK version: 1.1.5 side effects:


Field Summary
static int OK
           
 
Constructor Summary
user_message_table(java.lang.String dir, edu.vt.marian.common.Debug debug)
          method description: this constructor will create a user message table object from the specified directory.
 
Method Summary
 int add_message(java.lang.String message, java.lang.String language)
          method description: this method will add the specified message into the table the message is in the specified language, a uniq id will be returned which can be used later to retrive the language uses the services of class(es): input parameter(s): message -- the message user want to add to the table language -- this specifies the language of the message output parameter(s): none return value: positive integer -- the message has been added into the table correctly, this is the id of the message 1 -- duplicated message identified 2 -- the language is not supported currently sychronization: none
 int exit(java.lang.String condition)
          method description: this method will save the content of this object to the directory from which it's created uses the services of class(es): session, session_table, session-manage input parameter(s): condition -- specify the condition under which this object exit, not used currently output parameter(s): none return value: OK -- the exit is smooth other -- sychronization: none
 java.lang.String get_current_language()
          method description: this method will return the current language this object is using.
 java.lang.String get_message_by_id(int message_id)
          method description: this method will return the message in this table corresponds to the specified id uses the services of class(es): input parameter(s): message_id -- the id of the message in the table, each message has a uniq id in the table output parameter(s): none return value: A string -- the message identified by the id, the message is in the current language null -- no message was found with the specified id in the table sychronization: none
 int save(java.lang.String dir)
          method description: this method will save the content of this object to the specified directory uses the services of class(es): input parameter(s): dir -- all the information about this user message table object will be written to this directory output parameter(s): none return value: OK -- the information has been written to the directory correctly 1 -- error happened when writting the information sychronization: none
 int set_language(java.lang.String language)
          method description: this method will set the language this object will use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK
Constructor Detail

user_message_table

public user_message_table(java.lang.String dir,
                          edu.vt.marian.common.Debug debug)
method description: this constructor will create a user message table object from the specified directory. uses the services of class(es): input parameter(s): dir -- this directory contains all the information about user message table table debug -- used for debugging output parameter(s): none return value: none sychronization: none
Method Detail

get_current_language

public java.lang.String get_current_language()
method description: this method will return the current language this object is using. uses the services of class(es): input parameter(s): none output parameter(s): none return value: the current language used as a string sychronization: none

set_language

public int set_language(java.lang.String language)
method description: this method will set the language this object will use. uses the services of class(es): input parameter(s): language -- this will become the new language used by this object, that means the method get_message_by_id() will return a string in this language output parameter(s): none return value: OK -- the new language has been set correctly 1 -- the new language is not supported currently sychronization: none

get_message_by_id

public java.lang.String get_message_by_id(int message_id)
method description: this method will return the message in this table corresponds to the specified id uses the services of class(es): input parameter(s): message_id -- the id of the message in the table, each message has a uniq id in the table output parameter(s): none return value: A string -- the message identified by the id, the message is in the current language null -- no message was found with the specified id in the table sychronization: none

add_message

public int add_message(java.lang.String message,
                       java.lang.String language)
method description: this method will add the specified message into the table the message is in the specified language, a uniq id will be returned which can be used later to retrive the language uses the services of class(es): input parameter(s): message -- the message user want to add to the table language -- this specifies the language of the message output parameter(s): none return value: positive integer -- the message has been added into the table correctly, this is the id of the message 1 -- duplicated message identified 2 -- the language is not supported currently sychronization: none

save

public int save(java.lang.String dir)
method description: this method will save the content of this object to the specified directory uses the services of class(es): input parameter(s): dir -- all the information about this user message table object will be written to this directory output parameter(s): none return value: OK -- the information has been written to the directory correctly 1 -- error happened when writting the information sychronization: none

exit

public int exit(java.lang.String condition)
method description: this method will save the content of this object to the directory from which it's created uses the services of class(es): session, session_table, session-manage input parameter(s): condition -- specify the condition under which this object exit, not used currently output parameter(s): none return value: OK -- the exit is smooth other -- sychronization: none