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

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.config.ConfigKey<Boolean>
      extended by uk.ac.starlink.ttools.plot2.config.BooleanConfigKey

public class BooleanConfigKey
extends ConfigKey<Boolean>

Config key for boolean values.

Since:
22 Feb 2013
Author:
Mark Taylor

Constructor Summary
BooleanConfigKey(ConfigMeta meta)
          Constructs a key with a false default.
BooleanConfigKey(ConfigMeta meta, boolean dflt)
          Constructs a key with explicit default.
 
Method Summary
 Specifier<Boolean> createSpecifier()
          Constructs a graphical control with which the user can specify a suitable value for association with this key.
 Boolean stringToValue(String txt)
          Decodes a string value to the value type of this key.
 String valueToString(Boolean 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
 

Constructor Detail

BooleanConfigKey

public BooleanConfigKey(ConfigMeta meta,
                        boolean dflt)
Constructs a key with explicit default.

Parameters:
meta - metadata
dflt - default value

BooleanConfigKey

public BooleanConfigKey(ConfigMeta meta)
Constructs a key with a false default.

Parameters:
meta - metadata
Method Detail

stringToValue

public Boolean 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<Boolean>
Parameters:
txt - string representation of value
Returns:
value
Throws:
ConfigException

valueToString

public String valueToString(Boolean 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<Boolean>
Parameters:
value - possible value associated with this key
Returns:
string representation

createSpecifier

public Specifier<Boolean> 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<Boolean>
Returns:
new specifier


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