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 java.lang.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.
-
Constructor Summary
Constructors Constructor Description RowSubset(java.lang.String name)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description RowSubset.Key
getKey()
Returns the key identifying this subset.java.lang.String
getMaskId()
Returns the mask identifier by which the content of this subset is recognised.java.lang.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(java.lang.String name)
Sets the name of this subset.java.lang.String
toString()
Returns this subset's name.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of this subset.- Returns:
- name
-
setName
public void setName(java.lang.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 java.lang.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 theGuiDataSpec
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 java.lang.String toString()
Returns this subset's name.- Overrides:
toString
in classjava.lang.Object
-
-