# 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

Constructors
Constructor
Description
`GuiDataSpec(TopcatModel tcModel, RowSubset subset, GuiCoordContent[] contents)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`uk.ac.starlink.ttools.plot2.data.UserDataReader`
`createUserDataReader()`
`uk.ac.starlink.ttools.plot2.data.Coord`
`getCoord(int ic)`
`int`
`getCoordCount()`
`String[]`
`getCoordDataLabels(int ic)`
Returns the strings supplied by the user to identify the user values corresponding to a particular coordinate.
`String`
`getCoordId(int ic)`
`GuiCoordContent`
`getGuiCoordContent(int ic)`
Returns the GuiCoordContent corresponding to a particular coordinate.
`long`
`getKnownRowCount()`
Returns the number of rows associated with this dataspec if it can be determined quickly.
`String`
`getMaskId()`
`long`
`getRowCount()`
Returns the number of rows associated with this data spec.
`RowSubset`
`getRowSubset()`
Returns the row subset forming the row mask for this dataspec.
`uk.ac.starlink.table.StarTable`
`getSourceTable()`
`TopcatModel`
`getTopcatModel()`
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`
`isMaskTrue()`

### Methods inherited from class uk.ac.starlink.ttools.plot2.data.AbstractDataSpec

`equals, hashCode`

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### GuiDataSpec

public GuiDataSpec(TopcatModel tcModel, RowSubset subset, GuiCoordContent[] contents)
Constructor.

Parameters:
  `tcModel` - topcat model supplying data
  `subset` - row inclusion mask
  `contents` - 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

public String getCoordId(int ic)

### getMaskId

public String 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

public TopcatModel getTopcatModel()
Returns the topcat model supplying the data for this data spec.

Returns:
  topcat model

### getRowSubset

public RowSubset getRowSubset()
Returns the row subset forming the row mask for this dataspec.

Returns:
  row subset

### getGuiCoordContent

public GuiCoordContent getGuiCoordContent(int ic)
Returns the GuiCoordContent corresponding to a particular coordinate.

Parameters:
  `ic` - coord index
Returns:
  user-supplied coordinate information

### getCoordDataLabels

public String[] getCoordDataLabels(int ic)
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

public static TopcatModel getTopcatModel(uk.ac.starlink.ttools.plot2.data.DataSpec dataSpec)
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