Class IntegerCoord

  • All Implemented Interfaces:
    Coord

    public class IntegerCoord
    extends SingleCoord
    Coord implementation for integer values. A selection of integer lengths is available.
    Since:
    1 Dec 2015
    Author:
    Mark Taylor
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  IntegerCoord.IntType
      Enumerates the avaialable integer types.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object inputToStorage​(java.lang.Object[] userValues, uk.ac.starlink.table.DomainMapper[] mappers)
      Turns a quantity in the user view to a plotting view object.
      int readIntCoord​(Tuple tuple, int icol)
      Reads an integer value from an appropriate field in a given Tuple.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IntegerCoord

        public IntegerCoord​(InputMeta meta,
                            boolean isRequired,
                            IntegerCoord.IntType itype)
        Constructor.
        Parameters:
        meta - input value metadata
        isRequired - true if this coordinate is required for plotting
        itype - defines integer length used
    • Method Detail

      • inputToStorage

        public java.lang.Object inputToStorage​(java.lang.Object[] userValues,
                                               uk.ac.starlink.table.DomainMapper[] mappers)
        Description copied from interface: Coord
        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:
        userValues - per-input values
        mappers - per-input domain mappers, each may be null
        Returns:
        object of the type corresponding to the result of Coord.getStorageType(); not null
      • readIntCoord

        public int readIntCoord​(Tuple tuple,
                                int icol)
        Reads an integer value from an appropriate field in a given Tuple.
        Parameters:
        tuple - tuple
        icol - index of field in tuple corresponding to this Coord
        Returns:
        value of integer field