Interface Coord

  • All Known Implementing Classes:
    BooleanCoord, FloatingArrayCoord, FloatingCoord, IntegerCoord, LongCoord, SingleCoord, SkyCoord, StringCoord

    public interface Coord
    Defines a coordinate quantity in terms of both the user's view of it and its representation for use in plotting. The inputToStorage(java.lang.Object[], uk.ac.starlink.table.DomainMapper[]) method translates between these two representations.

    An implementation of this class defines an additional read*Coord(Tuple,int) method which is able to read appropriate coordinate values from a suitable field of a Tuple. That behaviour is not enforced or defined in this interface using generic types, partly in order to allow use of primitive types and eliminate unnecessary use of wrapper classes.

    In many cases, both the input and the plotting views will be a scalar, in which case there will be only one Input. One notable case for which this is not true is for SkyCoord, which has two input coordinates (lat + long) and three storage coordinates (x, y, z vector).

    Since:
    4 Feb 2013
    Author:
    Mark Taylor
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Input[] getInputs()
      Returns specifications of the one or more input values the user supplies to provide the data values for this coord.
      StorageType getStorageType()
      Returns a code indicating how the quantity defined by this object is stored internally and presented to the plotting classes.
      java.lang.Object inputToStorage​(java.lang.Object[] inputValues, uk.ac.starlink.table.DomainMapper[] inputMappers)
      Turns a quantity in the user view to a plotting view object.
      boolean isRequired()
      Indicates whether this item must have a non-blank value in order for a plot to be possible.
    • Method Detail

      • getInputs

        Input[] getInputs()
        Returns specifications of the one or more input values the user supplies to provide the data values for this coord.
        Returns:
        one or more items describing the user input values for this quantity
      • isRequired

        boolean isRequired()
        Indicates whether this item must have a non-blank value in order for a plot to be possible.
        Returns:
        if true, values must be supplied to make a plot
      • getStorageType

        StorageType getStorageType()
        Returns a code indicating how the quantity defined by this object is stored internally and presented to the plotting classes.
        Returns:
        storage type enum instance
      • inputToStorage

        java.lang.Object inputToStorage​(java.lang.Object[] inputValues,
                                        uk.ac.starlink.table.DomainMapper[] inputMappers)
        Turns a quantity in the user view to a plotting view object. The return value is never null.

        The supplied parameters both correspond (have the same length as) this object's Inputs array. For each Input, the corresponding element of the inputValues array gives the value obtained from the user-supplied data (matching Input.getValueClass()), and the corresponding element of the inputMappers array gives a DomainMapper object (consistent with Input.getDomain()). InputMappers may be null however, and in many cases, coordinates are not sensitive to domains, and for those cases implementations will ignore inputMappers.

        Parameters:
        inputValues - per-input values
        inputMappers - per-input domain mappers, each may be null
        Returns:
        object of the type corresponding to the result of getStorageType(); not null