Class TimeConfigKey
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.config.ConfigKey<java.lang.Double>
-
- uk.ac.starlink.ttools.plot2.config.TimeConfigKey
-
public class TimeConfigKey extends ConfigKey<java.lang.Double>
Config key for values in the time domain. The value returned is a time in the domain defined byTimeMapper, that is unix seconds.- Since:
- 15 Aug 2013
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFORMAT_XMLXML <p> element describing the text input format.
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Specifier<java.lang.Double>createSpecifier()Constructs a graphical control with which the user can specify a suitable value for association with this key.java.lang.DoublestringToValue(java.lang.String txt)Decodes a string value to the value type of this key.java.lang.StringvalueToString(java.lang.Double value)Reports a value as a string.-
Methods inherited from class uk.ac.starlink.ttools.plot2.config.ConfigKey
cast, getDefaultValue, getMeta, getValueClass, toString
-
-
-
-
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- metadatadfltUnixSeconds- default value as seconds since Unix epoch
-
-
Method Detail
-
valueToString
public java.lang.String valueToString(java.lang.Double value)
Description copied from class:ConfigKeyReports a value as a string. If at all possible the roundtripping should be possible, sostringToValue(valueToString(v)).equals(v). A null value, if permitted, should be represented as an empty string.- Specified by:
valueToStringin classConfigKey<java.lang.Double>- Parameters:
value- possible value associated with this key- Returns:
- string representation
-
stringToValue
public java.lang.Double stringToValue(java.lang.String txt) throws ConfigExceptionDescription copied from class:ConfigKeyDecodes 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:
stringToValuein classConfigKey<java.lang.Double>- Parameters:
txt- string representation of value- Returns:
- value
- Throws:
ConfigException
-
createSpecifier
public Specifier<java.lang.Double> createSpecifier()
Description copied from class:ConfigKeyConstructs a graphical control with which the user can specify a suitable value for association with this key.- Specified by:
createSpecifierin classConfigKey<java.lang.Double>- Returns:
- new specifier
-
-