|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.task.ParameterFinder<P>
public abstract class ParameterFinder<P extends Parameter>
Used for obtaining a parameter qualified by an optional suffix.
In some cases, it is desirable to allow parameters which are
logically associated with a layer suffix to be specified without
the suffix, for instance if you have three layers using the
same table x
, it's nice to write "in=x
"
as a shorthand for "in1=x in2=x in3=x
".
But if in2=x
is present in the environment, that will
be used in preference.
Constructor Summary | |
---|---|
ParameterFinder()
|
Method Summary | |
---|---|
abstract P |
createParameter(String suffix)
Concrete subclasses must implement this method to create a parameter of the right type with an arbitrary suffix. |
P |
findParameter(Environment env,
String fullSuffix)
Returns an existing parameter to use for obtaining a value associated with the given layer suffix from the given environment. |
P |
findParameterByName(String target,
String fullSuffix)
Attempts to locate a parameter known by this finder with the given name. |
P |
getParameter(Environment env,
String fullSuffix)
Calls findParameter(uk.ac.starlink.task.Environment, java.lang.String) , but if the result is null,
a parameter with the full suffix is returned. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParameterFinder()
Method Detail |
---|
public abstract P createParameter(String suffix)
suffix
- arbitrary suffix
public P getParameter(Environment env, String fullSuffix)
findParameter(uk.ac.starlink.task.Environment, java.lang.String)
, but if the result is null,
a parameter with the full suffix is returned.
In that case, the environment doesn't already have a
value for the parameter, but it may take steps to obtain one
(like asking the user).
env
- execution environment, possibly populated with valuesfullSuffix
- suffix associated with the layer for which
the value is required
public P findParameter(Environment env, String fullSuffix)
env
- execution environment, possibly populated with valuesfullSuffix
- suffix associated with the layer for which
the value is required
public P findParameterByName(String target, String fullSuffix)
target
- required parameter name (not case-sensitive)fullSuffix
- suffix associated with the layer for which
the value is required
target
, or null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |