Package uk.ac.starlink.ttools.plot2.data
Class IntegerCoord
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.data.SingleCoord
-
- uk.ac.starlink.ttools.plot2.data.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.
-
Constructor Summary
Constructors Constructor Description IntegerCoord(InputMeta meta, boolean isRequired, IntegerCoord.IntType itype)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.function.Function<java.lang.Object[],java.lang.Number>
inputStorage(uk.ac.starlink.table.ValueInfo[] infos, uk.ac.starlink.table.DomainMapper[] dms)
Provides a function to turn 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 uk.ac.starlink.ttools.plot2.data.SingleCoord
getInput, getInputs, getStorageType, isRequired
-
-
-
-
Constructor Detail
-
IntegerCoord
public IntegerCoord(InputMeta meta, boolean isRequired, IntegerCoord.IntType itype)
Constructor.- Parameters:
meta
- input value metadataisRequired
- true if this coordinate is required for plottingitype
- defines integer length used
-
-
Method Detail
-
inputStorage
public java.util.function.Function<java.lang.Object[],java.lang.Number> inputStorage(uk.ac.starlink.table.ValueInfo[] infos, uk.ac.starlink.table.DomainMapper[] dms)
Description copied from interface:Coord
Provides a function to turn a quantity in the user view to a plotting view object.The supplied
infos
anddomainMappers
arrays correspond to (have the same length as) this object's Inputs array, and may influence the return values. However, Coord instances that always behave the same way (for instance whose Input Domains have fixed DomainMappers) are free to ignore these arguments.The returned function converts an array of per-input user values to a storable object of the type corresponding to the result of
Coord.getStorageType()
; the return value of the returned function is never null.- Parameters:
infos
- per-input array of column input metadatadms
- per-input array of input value->domain value mappers- Returns:
- input values to storage object conversion function, or null if such conversions will never be possible
-
readIntCoord
public int readIntCoord(Tuple tuple, int icol)
Reads an integer value from an appropriate field in a given Tuple.- Parameters:
tuple
- tupleicol
- index of field in tuple corresponding to this Coord- Returns:
- value of integer field
-
-