Package uk.ac.starlink.topcat

# Class RowSubset

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

Direct Known Subclasses:
  `BitsRowSubset`, `BooleanColumnRowSubset`, `InverseRowSubset`, `SingleRowSubset`, `SyntheticRowSubset`

public abstract class RowSubset extends Object
Defines a selection of rows in a table model.

Author:
  Mark Taylor (Starlink)

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`RowSubset.Key`
Class used as subset identifier.

## Field Summary

Fields
Modifier and Type
Field
Description
`static RowSubset`
`ALL`
A subset containing all rows (`isIncluded` always true).
`static RowSubset`
`NONE`
A subset containing no rows (`isIncluded` always false).

## Constructor Summary

Constructors
Constructor
Description
`RowSubset(String name)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`RowSubset.Key`
`getKey()`
Returns the key identifying this subset.
`String`
`getMaskId()`
Returns the mask identifier by which the content of this subset is recognised.
`String`
`getName()`
Returns the name of this subset.
`abstract boolean`
`isIncluded(long lrow)`
Indicates whether a given row is in the subset or not.
`void`
`setKey(RowSubset.Key key)`
Sets the key identifying this subset.
`void`
`setName(String name)`
Sets the name of this subset.
`String`
`toString()`
Returns this subset's name.

### Methods inherited from class java.lang.Object

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

## Field Details

### ALL

public static RowSubset ALL
A subset containing all rows (`isIncluded` always true).

### NONE

public static RowSubset NONE
A subset containing no rows (`isIncluded` always false).

## Constructor Details

### RowSubset

public RowSubset(String name)
Constructor.

Parameters:
  `name` - subset name

## Method Details

### getName

public String getName()
Returns the name of this subset.

Returns:
  name

### setName

public void setName(String name)
Sets the name of this subset.

Parameters:
  `name` - new name

### getKey

public RowSubset.Key getKey()
Returns the key identifying this subset. This value is intended for use by the GUI; only one subset in use may have the same key at any one time, but if a subset goes out of use, its key may be passed on to a different one that is intended as a replacement that should inherit configuration set up for the original owner.

Returns:
  identifer

### setKey

public void setKey(RowSubset.Key key)
Sets the key identifying this subset. A key no longer in use may be passed on to a new subset intended as its replacement.

Parameters:
  `key` - new key

### isIncluded

public abstract boolean isIncluded(long lrow)
Indicates whether a given row is in the subset or not.

Parameters:
  `lrow` - the index of the row in question
Returns:
  `true` iff row `lrow` is to be included

### getMaskId

public String getMaskId()
Returns the mask identifier by which the content of this subset is recognised.

In particular this value is used as a `maskId` by the `GuiDataSpec` class, which means that changing it will generally signal to the plotting system that the content of this subset has changed, and thus provoke a replot of layers dependent on it.

The default implementation returns a value determined by the identity of this RowSubset object (`TopcatUtils.identityString(java.lang.Object)`), but this method may be overridden by subclasses that wish to signal their changes, and in particular provoke replots, according to state. Implementations are not however obliged to make this value reflect their internal state, especially if it would be expensive to do so. Implementations should be fast.

Returns:
  mask content identifier

### toString

public String toString()
Returns this subset's name.

Overrides:
  `toString` in class `Object`