|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--comshell.Command
Supports methods for a command line interface
Field Summary | |
java.io.BufferedReader |
br
|
java.lang.String[] |
comnames
Command/Help index |
boolean |
echo
|
static int |
ECHO
|
static int |
EXEC
|
static int |
HELP
|
java.lang.String[] |
helpstring
|
java.io.InputStream |
is
|
static int |
LISTE
Basic common commands |
static int |
MAX_COMMANDS
|
static int |
MAX_INPUT
Static members |
java.io.PrintStream |
os
|
java.util.ArrayList |
params
|
static int |
REXEC
|
static int |
SET
|
int |
type
Class members |
int |
UNKNOWN
|
Constructor Summary | |
Command(java.io.InputStream is,
java.io.PrintStream os)
Constructor |
Method Summary | |
int |
addCommand(java.lang.String cname,
java.lang.String helpstr)
Registers a new command with the interface |
void |
clear()
Clears the last command and resets to UNKNOWN |
java.lang.String |
getParam(int index)
Retrieves a parameter for a command |
int |
numParams()
Returns number of params for command |
void |
parseStream()
Parses the current input stream. |
void |
setEcho(boolean e)
Turns echo on or off |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAX_INPUT
public static final int MAX_COMMANDS
public static final int LISTE
public static final int SET
public static final int HELP
public static final int ECHO
public static final int EXEC
public static final int REXEC
public int UNKNOWN
public java.lang.String[] comnames
public java.lang.String[] helpstring
public int type
public boolean echo
public java.util.ArrayList params
public java.io.BufferedReader br
public java.io.InputStream is
public java.io.PrintStream os
Constructor Detail |
public Command(java.io.InputStream is, java.io.PrintStream os)
is
- InputStream to processos
- OutputStream to write data toMethod Detail |
public int addCommand(java.lang.String cname, java.lang.String helpstr)
cname
- The command name (as it will be invoked)helpstr
- Help information to printed out when listing
this commandpublic void setEcho(boolean e)
e
- Set true for echo onpublic void clear()
public int numParams()
public java.lang.String getParam(int index)
index
- Which parameter to accesspublic void parseStream() throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |