uk.ac.starlink.ttools.plot2.config
Class TimeConfigKey

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.config.ConfigKey<Double>
      extended by uk.ac.starlink.ttools.plot2.config.TimeConfigKey

public class TimeConfigKey
extends ConfigKey<Double>

Config key for values in the time domain. The value returned is a time in the domain defined by TimeMapper, that is unix seconds.

Since:
15 Aug 2013
Author:
Mark Taylor

Field Summary
static String FORMAT_XML
          XML <p> element describing the text input format.
 
Constructor Summary
TimeConfigKey(ConfigMeta meta)
          Constructs a key with no default value.
TimeConfigKey(ConfigMeta meta, double dfltUnixSeconds)
          Constructs a key with a given default value.
 
Method Summary
 Specifier<Double> createSpecifier()
          Constructs a graphical control with which the user can specify a suitable value for association with this key.
 Double stringToValue(String txt)
          Decodes a string value to the value type of this key.
 String valueToString(Double value)
          Reports a value as a string.
 
Methods inherited from class uk.ac.starlink.ttools.plot2.config.ConfigKey
cast, getDefaultValue, getMeta, getValueClass, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FORMAT_XML

public static final String FORMAT_XML
XML <p> element describing the text input format.

Constructor Detail

TimeConfigKey

public TimeConfigKey(ConfigMeta meta)
Constructs a key with no default value.

Parameters:
meta - metadata

TimeConfigKey

public TimeConfigKey(ConfigMeta meta,
                     double dfltUnixSeconds)
Constructs a key with a given default value.

Parameters:
meta - metadata
dfltUnixSeconds - default value as seconds since Unix epoch
Method Detail

valueToString

public String valueToString(Double value)
Description copied from class: ConfigKey
Reports a value as a string. If at all possible the roundtripping should be possible, so stringToValue(valueToString(v)).equals(v). A null value, if permitted, should be represented as an empty string.

Specified by:
valueToString in class ConfigKey<Double>
Parameters:
value - possible value associated with this key
Returns:
string representation

stringToValue

public Double stringToValue(String txt)
                     throws ConfigException
Description copied from class: ConfigKey
Decodes a string value to the value type of this key. An empty string should be interpreted as a null value, but this may cause an exception if null is not a permissible value for this key.

Specified by:
stringToValue in class ConfigKey<Double>
Parameters:
txt - string representation of value
Returns:
value
Throws:
ConfigException

createSpecifier

public Specifier<Double> createSpecifier()
Description copied from class: ConfigKey
Constructs a graphical control with which the user can specify a suitable value for association with this key.

Specified by:
createSpecifier in class ConfigKey<Double>
Returns:
new specifier


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