Class DoubleArrayConfigKey
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.config.ConfigKey<double[]>
-
- uk.ac.starlink.ttools.plot2.config.DoubleArrayConfigKey
-
public class DoubleArrayConfigKey extends ConfigKey<double[]>
Config key for a list of floating point values.- Since:
- 9 Jan 2017
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description DoubleArrayConfigKey(ConfigMeta meta, double[] dflt)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Specifier<double[]>
createSpecifier()
Constructs a graphical control with which the user can specify a suitable value for association with this key.double[]
stringToValue(java.lang.String txt)
Decodes a string value to the value type of this key.java.lang.String
valueToString(double[] dvals)
Reports a value as a string.-
Methods inherited from class uk.ac.starlink.ttools.plot2.config.ConfigKey
cast, getDefaultValue, getMeta, getValueClass, toString
-
-
-
-
Constructor Detail
-
DoubleArrayConfigKey
public DoubleArrayConfigKey(ConfigMeta meta, double[] dflt)
Constructor.- Parameters:
meta
- metadatadflt
- default value
-
-
Method Detail
-
valueToString
public java.lang.String valueToString(double[] dvals)
Description copied from class:ConfigKey
Reports 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:
valueToString
in classConfigKey<double[]>
- Parameters:
dvals
- possible value associated with this key- Returns:
- string representation
-
stringToValue
public double[] stringToValue(java.lang.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 classConfigKey<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 classConfigKey<double[]>
- Returns:
- new specifier
-
-