# Class TopcatTableNamer

java.lang.Object
uk.ac.starlink.topcat.TopcatTableNamer

All Implemented Interfaces:
  `uk.ac.starlink.ttools.task.TableNamer`

public class TopcatTableNamer extends Object implements uk.ac.starlink.ttools.task.TableNamer
TableNamer implementation for use with TOPCAT.

An instance of this class can be used to prepare a DescribedValue to be stashed in the Parameter list of a StarTable, where the value is the name to be used for that table.

Since:
  17 Sep 2024
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static final TopcatTableNamer`
`FILENAME_NAMER`
Namer instance that quotes filenames without directories.
`static final TopcatTableNamer`
`LABEL_NAMER`
Namer instance that uses TopcatModel labels.
`static final TopcatTableNamer`
`PATHNAME_NAMER`
Namer instance that quotes pathnames.
`static final TopcatTableNamer`
`TNUM_NAMER`
Namer instance that uses topcat table sequence numbers.

## Constructor Summary

Constructors
Constructor
Description
`TopcatTableNamer(String name, boolean hasFormat)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`List<uk.ac.starlink.ttools.task.Setting>`
`createInputTableSettings(uk.ac.starlink.ttools.task.AbstractInputTableParameter<?> inParam, uk.ac.starlink.ttools.task.FilterParameter filterParam, TopcatModel tcModel)`
Returns a list of settings for use with a stilts command that characterise a TopcatModel as an input table.
`static uk.ac.starlink.ttools.task.CredibleString`
`getSelectExpression(RowSubset rset)`
Returns a best effort at an expression indicating row selection corresponding to a given RowSubset.
`static uk.ac.starlink.table.StarTable`
`getTable(TopcatModel tcModel)`
Returns a table corresponding to the current apparent table of a topcat model, intended to be used with an instance of this class.
`uk.ac.starlink.table.TableBuilder`
`getTableFormat(uk.ac.starlink.table.StarTable table)`
`static TopcatTableNamer[]`
`getTableNamers()`
Returns a list of TableNamer objects that give the user options for referencing TopcatModels by a text string in generated stilts commands.
`uk.ac.starlink.ttools.task.CredibleString`
`nameTable(uk.ac.starlink.table.StarTable table)`
`String`
`toString()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### PATHNAME_NAMER

public static final TopcatTableNamer PATHNAME_NAMER
Namer instance that quotes pathnames.

### FILENAME_NAMER

public static final TopcatTableNamer FILENAME_NAMER
Namer instance that quotes filenames without directories.

### LABEL_NAMER

public static final TopcatTableNamer LABEL_NAMER
Namer instance that uses TopcatModel labels.

### TNUM_NAMER

public static final TopcatTableNamer TNUM_NAMER
Namer instance that uses topcat table sequence numbers.

## Constructor Details

### TopcatTableNamer

public TopcatTableNamer(String name, boolean hasFormat)
Constructor.

Parameters:
  `name` - TableNamer user name
  `hasFormat` - whether to report table format when available

## Method Details

### nameTable

public uk.ac.starlink.ttools.task.CredibleString nameTable(uk.ac.starlink.table.StarTable table)

Specified by:
  `nameTable` in interface `uk.ac.starlink.ttools.task.TableNamer`

### getTableFormat

public uk.ac.starlink.table.TableBuilder getTableFormat(uk.ac.starlink.table.StarTable table)

Specified by:
  `getTableFormat` in interface `uk.ac.starlink.ttools.task.TableNamer`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getTableNamers

public static TopcatTableNamer[] getTableNamers()
Returns a list of TableNamer objects that give the user options for referencing TopcatModels by a text string in generated stilts commands.

Returns:
  table namer user options

### getTable

public static uk.ac.starlink.table.StarTable getTable(TopcatModel tcModel)
Returns a table corresponding to the current apparent table of a topcat model, intended to be used with an instance of this class.

Its parameter list also contains parameters giving various naming options corresponding to the FileNamer instances defined by this class.

Parameters:
  `tcModel` - topcat model
Returns:
  table view for use with TopcatTableNamer instance

### createInputTableSettings

public List<uk.ac.starlink.ttools.task.Setting> createInputTableSettings(uk.ac.starlink.ttools.task.AbstractInputTableParameter<?> inParam, uk.ac.starlink.ttools.task.FilterParameter filterParam, TopcatModel tcModel)
Returns a list of settings for use with a stilts command that characterise a TopcatModel as an input table.

Parameters:
  `inParam` - stilts table input parameter
  `filterParam` - stilts table input filter parameter, or null
  `tcModel` - topcat model to represent as input
Returns:
  list of settings

### getSelectExpression

public static uk.ac.starlink.ttools.task.CredibleString getSelectExpression(RowSubset rset)
Returns a best effort at an expression indicating row selection corresponding to a given RowSubset. In some cases, for instance a subset defined by a bitmap, there's no way to do this that will result in an evaluatable expression, so in those cases just return the subset name or something.

Parameters:
  `rset` - row subset
Returns:
  attempt at expression giving row inclusion, not null