| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.obby4j.Command
public class Command
A command of the obby protocol as sent between clients and servers.
| Constructor Summary | |
|---|---|
Command(Protocol.Keyword keyword)
Creates a parameterless command with the given keyword.  | 
|
Command(Protocol.Keyword keyword,
        java.lang.String... params)
Creates a command from a keyword and a number of parameters.  | 
|
| Method Summary | |
|---|---|
 void | 
addParameter(java.lang.String param)
Adds a parameters.  | 
 int | 
getIntParam(int idx)
Returns the parameter at the given index as an int.  | 
 Protocol.Keyword | 
getKeyword()
 | 
 java.lang.String | 
getParam(int idx)
Returns the parameter at the given index.  | 
 java.lang.String[] | 
getParams()
Returns all parameters of a command.  | 
static Command | 
parseCommand(java.lang.String line)
Parses a single line received from a server into a Command instance.  | 
 java.lang.String | 
toString()
Returns a String representation of a command exactly as it would be send over the network.  | 
| Methods inherited from class java.lang.Object | 
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public Command(Protocol.Keyword keyword)
keyword - the keyword
public Command(Protocol.Keyword keyword,
               java.lang.String... params)
keyword - the keywordparams - the parameters| Method Detail | 
|---|
public void addParameter(java.lang.String param)
param - public int getIntParam(int idx)
idx - the index of the parameter
java.lang.NumberFormatException - if the parameter can't be parsed as an intpublic Protocol.Keyword getKeyword()
public java.lang.String getParam(int idx)
idx - the index of the parameter
public java.lang.String[] getParams()
public static Command parseCommand(java.lang.String line)
line - a single line as received from a server
public java.lang.String toString()
toString in class java.lang.Object
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||