Package uk.ac.starlink.topcat

## Class SyntheticRowSubset

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

-     public class SyntheticRowSubset
      extends RowSubset

  A `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:
    JEL

- - ### Field Summary

    - ### Fields inherited from class uk.ac.starlink.topcat.RowSubset

      `ALL, NONE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SyntheticRowSubset​(java.lang.String name, java.lang.String expression, uk.ac.starlink.ttools.jel.RandomJELRowReader rowReader)` | Constructs a new synthetic subset given a table and an algebraic expression.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getExpression()` | Returns the text of the expression used by this subset.
    `boolean` | `isIncluded​(long lrow)` | Indicates whether a given row is in the subset or not.
    `void` | `setExpression​(java.lang.String expression, uk.ac.starlink.ttools.jel.RandomJELRowReader rowReader)` | Sets the expression to use for this subset.

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

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

    - ### Methods inherited from class uk.ac.starlink.topcat.RowSubset

      `getName, setName, toString`

- - ### Constructor Detail

    - #### SyntheticRowSubset

          public SyntheticRowSubset​(java.lang.String name,
                                    java.lang.String expression,
                                    uk.ac.starlink.ttools.jel.RandomJELRowReader rowReader)
                             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 RowSubset
        `expression` - the algebraic expression
        `rowReader` - context for JEL expression evaluation
      Throws:
        `gnu.jel.CompilationException`

  - ### Method Detail

    - #### setExpression

          public void setExpression​(java.lang.String expression,
                                    uk.ac.starlink.ttools.jel.RandomJELRowReader rowReader)
                             throws gnu.jel.CompilationException

      Sets the expression to use for this subset.
      Parameters:
        `expression` - JEL expression
        `rowReader` - context for JEL expression evaluation
      Throws:
        `gnu.jel.CompilationException`

    - #### getExpression

          public java.lang.String getExpression()

      Returns the text of the expression used by this subset.
      Returns:
        expression

    - #### isIncluded

          public boolean isIncluded​(long lrow)

      Description copied from class: `RowSubset`
      Indicates whether a given row is in the subset or not.
      Specified by:
        `isIncluded` in class `RowSubset`
      Parameters:
        `lrow` - the index of the row in question
      Returns:
        `true` iff row `lrow` is to be included

Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.