Package uk.ac.starlink.topcat
Class RowSubset
java.lang.Object
uk.ac.starlink.topcat.RowSubset
- Direct Known Subclasses:
BitsRowSubset
,BooleanColumnRowSubset
,InverseRowSubset
,SingleRowSubset
,SyntheticRowSubset
Defines a selection of rows in a table model.
- Author:
- Mark Taylor (Starlink)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKey()
Returns the key identifying this subset.Returns the mask identifier by which the content of this subset is recognised.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
Sets the name of this subset.toString()
Returns this subset's name.
-
Field Details
-
ALL
A subset containing all rows (isIncluded always true). -
NONE
A subset containing no rows (isIncluded always false).
-
-
Constructor Details
-
RowSubset
Constructor.- Parameters:
name
- subset name
-
-
Method Details
-
getName
Returns the name of this subset.- Returns:
- name
-
setName
Sets the name of this subset.- Parameters:
name
- new name
-
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
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
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
Returns this subset's name.
-