|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.task.TerminalEnvironment
public class TerminalEnvironment
Implementation of Environment which accepts an initial command line, and communicates with the user using standard input and standard output.
This environment is somewhat deprecated in favour of the more capable
LineEnvironment
.
Field Summary | |
---|---|
static int |
NUM_TRIES
The number of goes you get to put in an invalid parameter. |
Constructor Summary | |
---|---|
TerminalEnvironment(String[] args,
Parameter[] params)
Constructs a new Environment based on a String array containing supplied arguments, and a list of parameters which may be encountered. |
Method Summary | |
---|---|
void |
acquireValue(Parameter par)
Sets the value of a parameter. |
void |
clear(Parameter par)
|
void |
clearValue(Parameter par)
Clears a value for a given parameter. |
PrintStream |
getErrorStream()
Returns System.err. |
String[] |
getNames()
Returns an array of parameter names which have been specified. |
PrintStream |
getOutputStream()
Returns System.out. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int NUM_TRIES
Constructor Detail |
---|
public TerminalEnvironment(String[] args, Parameter[] params) throws UsageException
args
- an array of words found on the command lineparams
- an array of Parameter objects which this Environment
may be asked to get values for
UsageException
Method Detail |
---|
public void clear(Parameter par)
public void acquireValue(Parameter par) throws TaskException
A more configurable order (cf ADAM PPATH/VPATH) could be implemented by adding some methods to Parameter and getting this method to query them.
acquireValue
in interface Environment
par
- the parameter whose value is to be set
TaskException
public void clearValue(Parameter par)
Environment
clearValue
in interface Environment
par
- the Parameter whose value is to be clearedpublic String[] getNames()
Environment
getNames
in interface Environment
public PrintStream getOutputStream()
getOutputStream
in interface Environment
public PrintStream getErrorStream()
getErrorStream
in interface Environment
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |