Package uk.ac.starlink.ttools.task
Class VariableTablesInput
java.lang.Object
uk.ac.starlink.ttools.task.VariableTablesInput
- All Implemented Interfaces:
TablesInput
TablesInput which allows a variable number of input tables, fixed at
runtime using an integer parameter. Each input table has its own
input format and filter parameters and so on.
This object constructs its list of parameters on the fly when the
environment is available (within getInputSpecs(uk.ac.starlink.task.Environment)
).
The getParameters()
method returns a list which is suitable
for documentation purposes only.
Execution environments which need the getParameters
call to return the actual list of parameters to be used may not
therefore be able to work with instances of this class.
- Since:
- 1 Jul 2010
- Author:
- Mark Taylor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Suffix applied to parameters to denote a symbolic variable part of the name, where the symbolic part can take integer values. -
Constructor Summary
ConstructorsConstructorDescriptionVariableTablesInput
(boolean useInFilters) Constructs an input tables parameter with a default base name.VariableTablesInput
(boolean useInFilters, String inName, String inWord) Constructs an input tables parameter with a given base name. -
Method Summary
Modifier and TypeMethodDescriptioncreateFilterParameter
(String label) Constructs an input filter parameter with a given distinguishing label.createInputParameter
(String label) Constructs an input table parameter with a given distinguishing label.uk.ac.starlink.task.IntegerParameter
Returns the parameter which contains the number of input tables that the user wants to use.getFilterParameter
(int i) Returns a parameter used for acquiring an input filter for one of the numbered input tables.getInputSpecs
(uk.ac.starlink.task.Environment env) Returns an array of InputTableSpec objects describing the input tables used by this task.getInputTableParameter
(int i) Returns a parameter used for acquiring one of the numbered input tables.uk.ac.starlink.task.Parameter<?>[]
Returns the parameters associated with this object.
-
Field Details
-
NUM_SUFFIX
Suffix applied to parameters to denote a symbolic variable part of the name, where the symbolic part can take integer values.- See Also:
-
-
Constructor Details
-
VariableTablesInput
public VariableTablesInput(boolean useInFilters) Constructs an input tables parameter with a default base name.- Parameters:
useInFilters
- whether to use input filter parameters
-
VariableTablesInput
Constructs an input tables parameter with a given base name.- Parameters:
useInFilters
- whether to use input filter parametersinName
- base name for parameterinWord
- base word describing parameter content for textual descriptions
-
-
Method Details
-
getCountParam
public uk.ac.starlink.task.IntegerParameter getCountParam()Returns the parameter which contains the number of input tables that the user wants to use.- Returns:
- count parameter
-
getParameters
public uk.ac.starlink.task.Parameter<?>[] getParameters()Description copied from interface:TablesInput
Returns the parameters associated with this object.- Specified by:
getParameters
in interfaceTablesInput
- Returns:
- parameters
-
getInputSpecs
public InputTableSpec[] getInputSpecs(uk.ac.starlink.task.Environment env) throws uk.ac.starlink.task.TaskException Description copied from interface:TablesInput
Returns an array of InputTableSpec objects describing the input tables used by this task.- Specified by:
getInputSpecs
in interfaceTablesInput
- Parameters:
env
- execution environment- Returns:
- input table specifiers
- Throws:
uk.ac.starlink.task.TaskException
-
getInputTableParameter
Description copied from interface:TablesInput
Returns a parameter used for acquiring one of the numbered input tables.Behaviour is undefined if you ask for a table index not applicable to this input.
- Specified by:
getInputTableParameter
in interfaceTablesInput
- Parameters:
i
- table index (0-based)- Returns:
- table input parameter
-
getFilterParameter
Description copied from interface:TablesInput
Returns a parameter used for acquiring an input filter for one of the numbered input tables.Behaviour is undefined if you ask for a table index not applicable to this input.
- Specified by:
getFilterParameter
in interfaceTablesInput
- Parameters:
i
- table index (0-based)- Returns:
- input filter parameter
-
createInputParameter
Constructs an input table parameter with a given distinguishing label.- Parameters:
label
- input identifier - typically "1", "2", etc- Returns:
- new input parameter
-
createFilterParameter
Constructs an input filter parameter with a given distinguishing label.- Parameters:
label
- input identifier - typically "1", "2", etc- Returns:
- new filter parameter
-