BooleanConfigKey, ChoiceConfigKey, CombinationConfigKey, DoubleArrayConfigKey, DoubleConfigKey, HiddenConfigKey, IntegerConfigKey, OptionConfigKey, StringConfigKey, SubrangeConfigKey, TimeConfigKey, ToggleNullConfigKeypublic abstract class ConfigKey<T>
extends java.lang.Object
ConfigMap,
this class has methods to allow a command-line or graphical interface
to be constructed for the corresponding values automatically.
Note that this class does not sport the
Equality
annotation. A ConfigKey is normally considered equal only to itself,
not to other similarly-named ConfigKeys.
| Constructor | Description |
|---|---|
ConfigKey(ConfigMeta meta,
java.lang.Class<T> clazz,
T dflt) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
T |
cast(java.lang.Object value) |
Converts an object to the value type of this key.
|
abstract Specifier<T> |
createSpecifier() |
Constructs a graphical control with which the user can
specify a suitable value for association with this key.
|
T |
getDefaultValue() |
Returns the default value associated with this key.
|
ConfigMeta |
getMeta() |
Returns metadata about this key.
|
java.lang.Class<T> |
getValueClass() |
Returns the type of value described by this key.
|
abstract T |
stringToValue(java.lang.String txt) |
Decodes a string value to the value type of this key.
|
java.lang.String |
toString() |
|
abstract java.lang.String |
valueToString(T value) |
Reports a value as a string.
|
public ConfigKey(ConfigMeta meta, java.lang.Class<T> clazz, T dflt)
meta - metadata describing this keyclazz - value type for the values indexed by this keydflt - default value when key not present in mappublic ConfigMeta getMeta()
public java.lang.Class<T> getValueClass()
public T getDefaultValue()
public T cast(java.lang.Object value)
value - untyped valuepublic abstract T stringToValue(java.lang.String txt) throws ConfigException
txt - string representation of valueConfigExceptionpublic abstract java.lang.String valueToString(T value)
stringToValue(valueToString(v)).equals(v).
A null value, if permitted, should be represented as an empty string.value - possible value associated with this keypublic abstract Specifier<T> createSpecifier()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.