Class JELDataSpec

java.lang.Object
uk.ac.starlink.ttools.plot2.data.AbstractDataSpec
uk.ac.starlink.ttools.plot2.task.JELDataSpec
All Implemented Interfaces:
DataSpec

public class JELDataSpec extends AbstractDataSpec
DataSpec implementation that works with JEL expressions. The mask and coord ID values are based on strings which are evaluated as JEL expressions in the context of the DataSpec's table. The constraints on ID equality are therefore met since equal expression strings applied against the same table must yield the same values.
Since:
1 Mar 2013
Author:
Mark Taylor
  • Constructor Summary

    Constructors
    Constructor
    Description
    JELDataSpec(uk.ac.starlink.table.StarTable table, String maskExpr, CoordValue[] coordValues)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an object that can be used to read the mask and coordinate values from a row sequence derived from this object's source table.
    getCoord(int ic)
    Returns the coord reader that can read the data for one of this object's output columns.
    int
    Returns the number of columns that this object produces.
    Returns the user input strings used to supply the value for a given coordinate in this DataSpec.
    getCoordId(int ic)
    Returns an identifier for one of the the columns produced by this object.
    Returns an identifier for the row mask for this object.
    uk.ac.starlink.table.StarTable
    Returns the table object from which this data spec's data is obtained.
    uk.ac.starlink.table.ValueInfo[]
    Returns the metadata, if known, for the values supplied by the user to provide data for one of this object's output columns.
    uk.ac.starlink.table.DomainMapper[]
    Returns the domain mappers to use for the values supplied by the user to provide data for one of this object's output columns.
    boolean
    isCoordBlank(int icoord)
    Indicates whether the value for a given coord specified by this object is known to have a constant, blank value in all cases.
    boolean
    Indicates whether the mask flag specified by this object is known always to be true.

    Methods inherited from class uk.ac.starlink.ttools.plot2.data.AbstractDataSpec

    equals, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JELDataSpec

      public JELDataSpec(uk.ac.starlink.table.StarTable table, String maskExpr, CoordValue[] coordValues) throws uk.ac.starlink.task.TaskException
      Constructor.
      Parameters:
      table - table containing data
      maskExpr - JEL boolean expression giving mask inclusion; null may be used to indicate unconditional inclusion
      coordValues - coordinate definitions for which columns are required, along with the JEL expressions for their values; note that the DomainMapper array is permitted to have missing elements
      Throws:
      uk.ac.starlink.task.TaskException
  • Method Details

    • getSourceTable

      public uk.ac.starlink.table.StarTable getSourceTable()
      Description copied from interface: DataSpec
      Returns the table object from which this data spec's data is obtained.
      Returns:
      data source table
    • getCoordCount

      public int getCoordCount()
      Description copied from interface: DataSpec
      Returns the number of columns that this object produces.
      Returns:
      TupleSequence column count
    • getCoordId

      public String getCoordId(int ic)
      Description copied from interface: DataSpec
      Returns an identifier for one of the the columns produced by this object. Coords with the same identifier must mean the same thing, and preferably vice versa.
      Parameters:
      ic - column index
      Returns:
      column identifier
    • getCoord

      public Coord getCoord(int ic)
      Description copied from interface: DataSpec
      Returns the coord reader that can read the data for one of this object's output columns.
      Parameters:
      ic - column index
      Returns:
      column data reader
    • getMaskId

      public String getMaskId()
      Description copied from interface: DataSpec
      Returns an identifier for the row mask for this object. Masks with the same identifier must mean the same thing, and preferably vice versa.
      Returns:
      mask identifier
    • getUserCoordInfos

      public uk.ac.starlink.table.ValueInfo[] getUserCoordInfos(int ic)
      Description copied from interface: DataSpec
      Returns the metadata, if known, for the values supplied by the user to provide data for one of this object's output columns.
      Parameters:
      ic - column index
      Returns:
      array of value infos for column data inputs; elements may be null if not known
    • getUserCoordMappers

      public uk.ac.starlink.table.DomainMapper[] getUserCoordMappers(int ic)
      Description copied from interface: DataSpec
      Returns the domain mappers to use for the values supplied by the user to provide data for one of this object's output columns. These objects define how the input values as supplied by the user are to be interpreted as the expected input values for this dataspec. In many cases this mapping is trivial (for instance Y axis coordinate), but in some (for instance absolute epoch) it may not be.
      Parameters:
      ic - column index
      Returns:
      array of DomainMappers for column data inputs
    • createUserDataReader

      public UserDataReader createUserDataReader()
      Description copied from interface: DataSpec
      Returns an object that can be used to read the mask and coordinate values from a row sequence derived from this object's source table. A given UserDataReader can only be used from a single thread, but multiple returns from this method may be used concurrently in different threads.
      Returns:
      new data reader
    • isMaskTrue

      public boolean isMaskTrue()
      Description copied from interface: DataSpec
      Indicates whether the mask flag specified by this object is known always to be true. If true is returned, then getUserDataReader().getMaskFlag will always return true. False negatives are permitted; even if the result is false, the mask may in fact always return true.
      Returns:
      true if all rows are known to be included in the mask
    • isCoordBlank

      public boolean isCoordBlank(int icoord)
      Description copied from interface: DataSpec
      Indicates whether the value for a given coord specified by this object is known to have a constant, blank value in all cases. Clients don't have to test this, since data stores will always dispense the relevant blank value based on this data spec, and should do so in an efficient manner, but it may be useful for clients to know in advance that a column is blank all the way down. False negatives are permitted: even if the result is false, the column may in fact have all blank values.
      Parameters:
      icoord - column index
      Returns:
      true if all values in the column are always blank
    • getCoordExpressions

      public String[] getCoordExpressions(int ic)
      Returns the user input strings used to supply the value for a given coordinate in this DataSpec.
      Parameters:
      ic - coordinate index
      Returns:
      array of JEL expressions entered by the user to provide data for the coordinate