Package uk.ac.starlink.ttools.plot2.task
Class ColumnDataSpec
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.data.AbstractDataSpec
-
- uk.ac.starlink.ttools.plot2.task.ColumnDataSpec
-
- All Implemented Interfaces:
DataSpec
public class ColumnDataSpec extends AbstractDataSpec
DataSpec implementation that simply selects columns by index from an input table. The mask is taken to be always true.- Since:
- 25 Sep 2013
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description ColumnDataSpec(uk.ac.starlink.table.StarTable table, Coord[] coords, int[][] userCoordColIndices)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UserDataReader
createUserDataReader()
Returns an object that can be used to read the mask and coordinate values from a row sequence derived from this object's source table.Coord
getCoord(int ic)
Returns the coord reader that can read the data for one of this object's output columns.int
getCoordCount()
Returns the number of columns that this object produces.java.lang.Object
getCoordId(int ic)
Returns an identifier for one of the the columns produced by this object.java.lang.Object
getMaskId()
Returns an identifier for the row mask for this object.uk.ac.starlink.table.StarTable
getSourceTable()
Returns the table object from which this data spec's data is obtained.uk.ac.starlink.table.ValueInfo[]
getUserCoordInfos(int ic)
Returns the metadata, if known, for the values supplied by the user to provide data for one of this object's output columns.boolean
isCoordBlank(int icoord)
Indicates whether the value for a given coord specified by this object is known to have a constant, blank value in all cases.-
Methods inherited from class uk.ac.starlink.ttools.plot2.data.AbstractDataSpec
equals, hashCode
-
-
-
-
Constructor Detail
-
ColumnDataSpec
public ColumnDataSpec(uk.ac.starlink.table.StarTable table, Coord[] coords, int[][] userCoordColIndices)
Constructor.- Parameters:
table
- input tablecoords
- coordinate definitions for which columns are requireduserCoordColIndices
- nCoord-element array, each element an array of column indices for the table columns containing user values for the corresponding Coord
-
-
Method Detail
-
getSourceTable
public uk.ac.starlink.table.StarTable getSourceTable()
Description copied from interface:DataSpec
Returns the table object from which this data spec's data is obtained.- Returns:
- data source table
-
getCoordCount
public int getCoordCount()
Description copied from interface:DataSpec
Returns the number of columns that this object produces.- Returns:
- TupleSequence column count
-
getCoordId
public java.lang.Object getCoordId(int ic)
Description copied from interface:DataSpec
Returns an identifier for one of the the columns produced by this object.- Parameters:
ic
- column index- Returns:
- column identifier, should implement equals sensibly
-
getCoord
public Coord getCoord(int ic)
Description copied from interface:DataSpec
Returns the coord reader that can read the data for one of this object's output columns.- Parameters:
ic
- column index- Returns:
- column data reader
-
getMaskId
public java.lang.Object getMaskId()
Description copied from interface:DataSpec
Returns an identifier for the row mask for this object.- Returns:
- mask identifier, should implement equals sensibly
-
getUserCoordInfos
public uk.ac.starlink.table.ValueInfo[] getUserCoordInfos(int ic)
Description copied from interface:DataSpec
Returns the metadata, if known, for the values supplied by the user to provide data for one of this object's output columns.- Parameters:
ic
- column index- Returns:
- array of value infos for column data; elements may be null if not known
-
createUserDataReader
public UserDataReader createUserDataReader()
Description copied from interface:DataSpec
Returns an object that can be used to read the mask and coordinate values from a row sequence derived from this object's source table. A given UserDataReader can only be used from a single thread, but multiple returns from this method may be used concurrently in different threads.- Returns:
- new data reader
-
isCoordBlank
public boolean isCoordBlank(int icoord)
Description copied from interface:DataSpec
Indicates whether the value for a given coord specified by this object is known to have a constant, blank value in all cases. Clients don't have to test this, since data stores will always dispense the relevant blank value based on this data spec, and should do so in an efficient manner, but it may be useful for clients to know in advance that a column is blank all the way down. False negatives are permitted: even if the result is false, the column may in fact have all blank values.- Parameters:
icoord
- column index- Returns:
- true if all values in the column are always blank
-
-