Class SyntheticRowSubset
RowSubset which uses an algebraic expression based on the
values of other columns in the same row to decide whether a row
is included or not.
The engine used for expression evaluation is the GNU Java Expressions Library (JEL).
- Author:
- Mark Taylor (Starlink)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class RowSubset
RowSubset.Key -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSyntheticRowSubset(String name, TopcatModel tcModel, String expression) Constructs a new synthetic subset given a table and an algebraic expression. -
Method Summary
Modifier and TypeMethodDescriptionReturns the text of the expression used by this subset.Returns the mask identifier by which the content of this subset is recognised.booleanisIncluded(long lrow) Indicates whether a given row is in the subset or not.voidsetExpression(String expression) Sets the expression to use for this subset.
-
Constructor Details
-
SyntheticRowSubset
public SyntheticRowSubset(String name, TopcatModel tcModel, String expression) throws gnu.jel.CompilationException Constructs a new synthetic subset given a table and an algebraic expression.- Parameters:
name- the name to use for the new RowSubsettcModel- context for JEL expression evaluationexpression- the algebraic expression- Throws:
gnu.jel.CompilationException
-
-
Method Details
-
setExpression
Sets the expression to use for this subset.- Parameters:
expression- JEL expression- Throws:
gnu.jel.CompilationException
-
getExpression
Returns the text of the expression used by this subset.- Returns:
- expression
-
getMaskId
Description copied from class:RowSubsetReturns the mask identifier by which the content of this subset is recognised.In particular this value is used as a
maskIdby theGuiDataSpecclass, 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(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. -
isIncluded
public boolean isIncluded(long lrow) Description copied from class:RowSubsetIndicates whether a given row is in the subset or not.- Specified by:
isIncludedin classRowSubset- Parameters:
lrow- the index of the row in question- Returns:
trueiff rowlrowis to be included
-