Package uk.ac.starlink.ttools.task
Class ConsumerTask
- java.lang.Object
-
- uk.ac.starlink.ttools.task.ConsumerTask
-
- All Implemented Interfaces:
uk.ac.starlink.task.Task
- Direct Known Subclasses:
MapperTask
,RegQuery
,SingleMapperTask
,TableCone
,TableLoop
,TapResume
public abstract class ConsumerTask extends java.lang.Object implements uk.ac.starlink.task.Task
Abstract task which takes an input table and disposes of it. Concrete subclasses must supply the table.- Since:
- 29 Aug 2005
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description ConsumerTask(java.lang.String purpose, ProcessingMode outMode, boolean useOutFilter)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description uk.ac.starlink.task.Executable
createExecutable(uk.ac.starlink.task.Environment env)
abstract TableProducer
createProducer(uk.ac.starlink.task.Environment env)
Returns an object which can produce the effective output table which will be consumed by this task.static TableProducer
createProducer(uk.ac.starlink.task.Environment env, FilterParameter filterParam, InputTableParameter inParam)
Constructs a table producer given an input parameter and an input filter parameter.static java.lang.String
getIdentity(uk.ac.starlink.table.StarTable table)
Returns an identification string for a table that has been produced by the TableProducer from this class'screateProducer(uk.ac.starlink.task.Environment)
method.ProcessingMode
getOutputMode()
Returns this task's output mode.protected java.util.List<uk.ac.starlink.task.Parameter<?>>
getParameterList()
Returns the parameter list for this task; it may be modified.uk.ac.starlink.task.Parameter<?>[]
getParameters()
java.lang.String
getPurpose()
-
-
-
Constructor Detail
-
ConsumerTask
public ConsumerTask(java.lang.String purpose, ProcessingMode outMode, boolean useOutFilter)
Constructor.- Parameters:
purpose
- one-line description of the taskoutMode
- processing mode which determines the destination of the processed tableuseOutFilter
- allow specification of filters for output table
-
-
Method Detail
-
getPurpose
public java.lang.String getPurpose()
- Specified by:
getPurpose
in interfaceuk.ac.starlink.task.Task
-
getParameters
public uk.ac.starlink.task.Parameter<?>[] getParameters()
- Specified by:
getParameters
in interfaceuk.ac.starlink.task.Task
-
getParameterList
protected java.util.List<uk.ac.starlink.task.Parameter<?>> getParameterList()
Returns the parameter list for this task; it may be modified.- Returns:
- parameter list
-
createProducer
public abstract TableProducer createProducer(uk.ac.starlink.task.Environment env) throws uk.ac.starlink.task.TaskException
Returns an object which can produce the effective output table which will be consumed by this task. The table produced by the resulting producer can be fed to thegetIdentity(uk.ac.starlink.table.StarTable)
method.- Parameters:
env
- execution environment- Returns:
- table producer
- Throws:
uk.ac.starlink.task.TaskException
-
createExecutable
public uk.ac.starlink.task.Executable createExecutable(uk.ac.starlink.task.Environment env) throws uk.ac.starlink.task.TaskException
- Specified by:
createExecutable
in interfaceuk.ac.starlink.task.Task
- Throws:
uk.ac.starlink.task.TaskException
-
getOutputMode
public ProcessingMode getOutputMode()
Returns this task's output mode.- Returns:
- output mode
-
createProducer
public static TableProducer createProducer(uk.ac.starlink.task.Environment env, FilterParameter filterParam, InputTableParameter inParam) throws uk.ac.starlink.task.TaskException
Constructs a table producer given an input parameter and an input filter parameter. Tables which are generated by equal input parameters will evaluate as equal in the sense of Object.equals().- Parameters:
env
- execution environmentfilterParam
- parameter giving filter steps (or null)inParam
- parameter giving input table- Returns:
- table producer, or null if the table input parameter has a (permitted) blank value
- Throws:
uk.ac.starlink.task.TaskException
-
getIdentity
public static java.lang.String getIdentity(uk.ac.starlink.table.StarTable table)
Returns an identification string for a table that has been produced by the TableProducer from this class'screateProducer(uk.ac.starlink.task.Environment)
method. This string amalgamates the table location and any filters applied to produce it, so it should be usable elsewhere, including in unrelated JVMs, to identify a table.- Parameters:
table
- input table produced by this task- Returns:
- unique table identifier
-
-