uk.ac.starlink.task.Environmentpublic class AddEnvironment
extends java.lang.Object
implements uk.ac.starlink.task.Environment
Note this does not work perfectly, because of bad design of the
Environment class. The acquireValue method can end up
passing an instance of the wrapped environment to a parameter,
which means that subequent environment accesses made under the control
of that parameter will not pick up entries added to this environment.
A redesign of the Environment class is the only good way out of this.
Until then you have to hack round it by explicitly calling acquireValue
from this class on dependent variables before it gets done under control
of the variable they depend on.
| Constructor | Description |
|---|---|
AddEnvironment(uk.ac.starlink.task.Environment baseEnv,
java.util.Map<java.lang.String,java.lang.String> addMap) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
acquireValue(uk.ac.starlink.task.Parameter par) |
|
void |
clearValue(uk.ac.starlink.task.Parameter par) |
|
static AddEnvironment |
createAddEnvironment(uk.ac.starlink.task.Environment baseEnv,
java.util.Map<java.lang.String,java.lang.String> addMap) |
Returns an AddEnvironment based on a supplied base environment and
a map of key-value pairs.
|
java.io.PrintStream |
getErrorStream() |
|
java.lang.String[] |
getNames() |
|
java.io.PrintStream |
getOutputStream() |
public AddEnvironment(uk.ac.starlink.task.Environment baseEnv,
java.util.Map<java.lang.String,java.lang.String> addMap)
baseEnv - base environmentaddMap - addional key-value pairs to add to this environmentpublic void acquireValue(uk.ac.starlink.task.Parameter par)
throws uk.ac.starlink.task.TaskException
acquireValue in interface uk.ac.starlink.task.Environmentuk.ac.starlink.task.TaskExceptionpublic void clearValue(uk.ac.starlink.task.Parameter par)
clearValue in interface uk.ac.starlink.task.Environmentpublic java.lang.String[] getNames()
getNames in interface uk.ac.starlink.task.Environmentpublic java.io.PrintStream getOutputStream()
getOutputStream in interface uk.ac.starlink.task.Environmentpublic java.io.PrintStream getErrorStream()
getErrorStream in interface uk.ac.starlink.task.Environmentpublic static AddEnvironment createAddEnvironment(uk.ac.starlink.task.Environment baseEnv, java.util.Map<java.lang.String,java.lang.String> addMap)
baseEnv - base environmentaddMap - addional key-value pairs to add to this environmentCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.