|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.gjsa.ServerRequest
Representation of a Request sent by a GJSA client to a server. A request consists of a command and an arbitrary list of parameters.
Field Summary | |
int |
command
|
static java.util.List |
cshv
|
private static Logger |
mess
|
java.lang.Object[] |
param
|
Constructor Summary | |
ServerRequest()
|
|
ServerRequest(int c)
|
|
ServerRequest(int c,
java.lang.Object p1)
|
|
ServerRequest(int c,
java.lang.Object[] x)
|
|
ServerRequest(int c,
java.lang.Object p1,
java.lang.Object p2)
|
|
ServerRequest(int c,
java.lang.Object p1,
java.lang.Object p2,
java.lang.Object p3)
|
|
ServerRequest(int c,
java.lang.Object p1,
java.lang.Object p2,
java.lang.Object p3,
java.lang.Object p4)
|
Method Summary | |
static void |
addChatSymbolHolder(ChatSymbolHolder cshx)
|
static boolean |
convertBooleanArgument(java.lang.Object arg,
boolean defaultvalue)
Converts an argument with boolean background into a boolean. |
static int |
convertIntegerArgument(java.lang.Object o)
Return an integer representation of the given object. |
static int |
convertIntegerArgument(java.lang.Object o,
int defaultvalue)
Return an integer representation of the given object or the default value if the object is null. |
boolean |
getBooleanParam(int i)
Returns the i-th parameter as boolean value. |
boolean |
getBooleanParam(int i,
boolean defaultvalue)
Returns the i-th parameter as boolean value or default if parameter is not given. |
int |
getCommand()
|
java.lang.String |
getCommandName()
|
static int |
getCommandNum(java.lang.String n)
|
java.util.List |
getIntListParam(int i)
Returns the i-th parameter as List of Integer, even if it is not a List. |
int |
getIntParam(int i)
Returns the i-th parameter as int value or default if paramter is not given. |
int |
getIntParam(int i,
int defaultvalue)
Returns the i-th parameter as int value or default if paramter is not given. |
java.lang.Object |
getParam(int i)
Return i-th parameter or null if parameter array is shorter. |
int |
getParamCount()
Return the number of parameters which is taken from the length of the parameter array. |
QuickIntArray |
getQuickIntArrayParam(int i)
Returns the i-th parameter as QuickIntArray, even if it is not one in the first place. |
int |
getSymbolTableArgument(int i,
ChatSymbolHolder symboltable)
Returns the i-th parameter as symbol table argument. |
java.util.List |
getVersion()
|
void |
prependParam(java.lang.Object o)
Prepend the given parameter as first one. |
ServerRequest |
setCmdAndParams(int cmd,
java.lang.Object[] params)
Combined functional init method. |
void |
setCommand(int cmd)
|
static void |
setLogger(Logger m)
Set a class logger. |
void |
setParam(int i,
java.lang.Object prms)
|
void |
setParam(java.lang.Object[] prms)
|
java.lang.String |
toString()
convert to a string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static Logger mess
public static java.util.List cshv
public int command
public java.lang.Object[] param
Constructor Detail |
public ServerRequest()
public ServerRequest(int c)
public ServerRequest(int c, java.lang.Object[] x)
public ServerRequest(int c, java.lang.Object p1)
public ServerRequest(int c, java.lang.Object p1, java.lang.Object p2)
public ServerRequest(int c, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
public ServerRequest(int c, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4)
Method Detail |
public static void setLogger(Logger m)
public static void addChatSymbolHolder(ChatSymbolHolder cshx)
public void prependParam(java.lang.Object o)
o
- New parameterpublic java.util.List getVersion()
public java.lang.String getCommandName()
public static int getCommandNum(java.lang.String n)
public java.lang.String toString()
public void setCommand(int cmd)
public int getCommand()
public void setParam(java.lang.Object[] prms)
public void setParam(int i, java.lang.Object prms)
public ServerRequest setCmdAndParams(int cmd, java.lang.Object[] params)
sc.query(sq.setCmdAndParams(a,new Object[] {b,c,d}));
.
cmd
- The command to sendparams
- An array of parameters
public java.lang.Object getParam(int i)
i
- index of wanted parameter
public static boolean convertBooleanArgument(java.lang.Object arg, boolean defaultvalue)
arg
- Some argument which should be evaluated as a booleandefaultvalue
- default value which is to be returned if the argument is null
public boolean getBooleanParam(int i)
i
- index of wanted parameter
java.lang.NullPointerException
- if parameter is not available
java.lang.ArrayIndexOutOfBoundsException
- if number of parameters is too smallpublic boolean getBooleanParam(int i, boolean defaultvalue)
i
- index of wanted parameterdefaultvalue
- value to return if parameter is not given
java.lang.ClassCastException
- if parameter is available but no Booleanpublic static int convertIntegerArgument(java.lang.Object o)
o
- Some value.
java.lang.NullPointerException
- if value is null
java.lang.NumberFormatException
- if the value cannot be converted into an integerpublic static int convertIntegerArgument(java.lang.Object o, int defaultvalue)
o
- Some value.defaultvalue
- default value if the value is null
public int getSymbolTableArgument(int i, ChatSymbolHolder symboltable)
i
- index of the wanted parametersymboltable
- Symbol table to convert string-type value
public int getIntParam(int i)
i
- position of the parameter in question
java.lang.NumberFormatException
- if the parameter is no Number and cannot be converted into an int
java.lang.NullPointerException
- if the parameter does not existpublic int getIntParam(int i, int defaultvalue)
i
- position of the parameter in questiondefaultvalue
- value to return if the parameter is not given
public java.util.List getIntListParam(int i)
i
- index of wanted parameter
java.lang.ClassCastException
- if parameter cannot be converted into List of Integerspublic QuickIntArray getQuickIntArrayParam(int i)
i
- index of wanted parameter
java.lang.ClassCastException
- if parameter cannot be converted into List of Integerspublic int getParamCount()
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |