public class TerminalEnvironment extends java.lang.Object implements Environment
This environment is somewhat deprecated in favour of the more capable
LineEnvironment.
| Modifier and Type | Field and Description |
|---|---|
static int |
NUM_TRIES
The number of goes you get to put in an invalid parameter.
|
| Constructor and Description |
|---|
TerminalEnvironment(java.lang.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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.io.PrintStream |
getErrorStream()
Returns System.err.
|
java.lang.String[] |
getNames()
Returns an array of parameter names which have been specified.
|
java.io.PrintStream |
getOutputStream()
Returns System.out.
|
public static int NUM_TRIES
public TerminalEnvironment(java.lang.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 forUsageExceptionpublic 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 Environmentpar - the parameter whose value is to be setTaskExceptionpublic void clearValue(Parameter par)
EnvironmentclearValue in interface Environmentpar - the Parameter whose value is to be clearedpublic java.lang.String[] getNames()
EnvironmentgetNames in interface Environmentpublic java.io.PrintStream getOutputStream()
getOutputStream in interface Environmentpublic java.io.PrintStream getErrorStream()
getErrorStream in interface EnvironmentCopyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.