uk.ac.starlink.ttools.plot2.data
Class StringCoord

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.data.SingleCoord
      extended by uk.ac.starlink.ttools.plot2.data.StringCoord
All Implemented Interfaces:
Coord

public class StringCoord
extends SingleCoord

Coord implementation for String values.

Since:
4 Feb 2013
Author:
Mark Taylor

Constructor Summary
StringCoord(InputMeta meta, boolean isRequired)
          Constructor.
 
Method Summary
 Object inputToStorage(Object[] values, DomainMapper[] mappers)
          Turns a quantity in the user view to a plotting view object.
 String readStringCoord(TupleSequence tseq, int icol)
          Reads a String value from an appropriate column in the current row of a given TupleSequence.
 
Methods inherited from class uk.ac.starlink.ttools.plot2.data.SingleCoord
getInput, getInputs, getStorageType, isRequired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringCoord

public StringCoord(InputMeta meta,
                   boolean isRequired)
Constructor.

Parameters:
meta - input value metadata
isRequired - true if this coordinate is required for plotting
Method Detail

inputToStorage

public Object inputToStorage(Object[] values,
                             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:
values - 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

readStringCoord

public String readStringCoord(TupleSequence tseq,
                              int icol)
Reads a String value from an appropriate column in the current row of a given TupleSequence.

Parameters:
tseq - sequence positioned at a row
icol - index of column in sequence corresponding to this Coord
Returns:
value of string column at the current sequence row


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.