Package uk.ac.starlink.topcat.plot2
Class GuiDataSpec
java.lang.Object
uk.ac.starlink.ttools.plot2.data.AbstractDataSpec
uk.ac.starlink.topcat.plot2.GuiDataSpec
- All Implemented Interfaces:
uk.ac.starlink.ttools.plot2.data.DataSpec
public class GuiDataSpec
extends uk.ac.starlink.ttools.plot2.data.AbstractDataSpec
DataSpec implementation used by TOPCAT classes.
All DataSpecs in use in the TOPCAT application are instances of this class.
- Since:
- 13 Mar 2013
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionGuiDataSpec
(TopcatModel tcModel, RowSubset subset, GuiCoordContent[] contents) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionuk.ac.starlink.ttools.plot2.data.UserDataReader
uk.ac.starlink.ttools.plot2.data.Coord
getCoord
(int ic) int
String[]
getCoordDataLabels
(int ic) Returns the strings supplied by the user to identify the user values corresponding to a particular coordinate.getCoordId
(int ic) getGuiCoordContent
(int ic) Returns the GuiCoordContent corresponding to a particular coordinate.long
Returns the number of rows associated with this dataspec if it can be determined quickly.long
Returns the number of rows associated with this data spec.Returns the row subset forming the row mask for this dataspec.uk.ac.starlink.table.StarTable
Returns the topcat model supplying the data for this data spec.static TopcatModel
getTopcatModel
(uk.ac.starlink.ttools.plot2.data.DataSpec dataSpec) Retrieves a TopcatModel from a data spec used within topcat.uk.ac.starlink.table.ValueInfo[]
getUserCoordInfos
(int ic) uk.ac.starlink.table.DomainMapper[]
getUserCoordMappers
(int ic) boolean
isCoordBlank
(int icoord) boolean
Methods inherited from class uk.ac.starlink.ttools.plot2.data.AbstractDataSpec
equals, hashCode
-
Constructor Details
-
GuiDataSpec
Constructor.- Parameters:
tcModel
- topcat model supplying datasubset
- row inclusion maskcontents
- coordinate value definitions
-
-
Method Details
-
getSourceTable
public uk.ac.starlink.table.StarTable getSourceTable() -
getCoordCount
public int getCoordCount() -
getCoord
public uk.ac.starlink.ttools.plot2.data.Coord getCoord(int ic) -
getCoordId
-
getMaskId
-
getUserCoordInfos
public uk.ac.starlink.table.ValueInfo[] getUserCoordInfos(int ic) -
getUserCoordMappers
public uk.ac.starlink.table.DomainMapper[] getUserCoordMappers(int ic) -
createUserDataReader
public uk.ac.starlink.ttools.plot2.data.UserDataReader createUserDataReader() -
isMaskTrue
public boolean isMaskTrue() -
isCoordBlank
public boolean isCoordBlank(int icoord) -
getTopcatModel
Returns the topcat model supplying the data for this data spec.- Returns:
- topcat model
-
getRowSubset
Returns the row subset forming the row mask for this dataspec.- Returns:
- row subset
-
getGuiCoordContent
Returns the GuiCoordContent corresponding to a particular coordinate.- Parameters:
ic
- coord index- Returns:
- user-supplied coordinate information
-
getCoordDataLabels
Returns the strings supplied by the user to identify the user values corresponding to a particular coordinate.- Parameters:
ic
- coord index- Returns:
- array of user input strings
-
getKnownRowCount
public long getKnownRowCount()Returns the number of rows associated with this dataspec if it can be determined quickly. If it would require a count, return -1.- Returns:
- row count or -1
-
getRowCount
@Slow public long getRowCount()Returns the number of rows associated with this data spec. In most cases this will execute quickly, but if necessary a count will be carried out by scanning the associated RowSubset. The result may not be 100% reliable. If the result is not known, -1 may be returned, though this shouldn't happen.- Returns:
- number of tuples in this object's tuple sequence, or -1 if not known (shouldn't happen)
-
getTopcatModel
Retrieves a TopcatModel from a data spec used within topcat. It does this by casting the supplied dataSpec to a GuiDataSpec. All DataSpecs within topcat are an instance of GuiDataSpec, though that is not enforced at compile-time.- Parameters:
dataSpec
- data spec- Returns:
- topcat model
-