|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.config.ConfigKey<boolean[]>
uk.ac.starlink.ttools.plot2.config.CombinationConfigKey
public class CombinationConfigKey
Config key that can select zero or more items from a short fixed list. The string representation is an unordered list of the first letters (lowercased) of each of the given option labels. So the labels had better have different initial letters.
Typically this is used for axes.
Constructor Summary | |
---|---|
CombinationConfigKey(ConfigMeta meta,
boolean[] dflt,
String[] optNames,
String nullLabel)
Constructs an instance with a specified default. |
|
CombinationConfigKey(ConfigMeta meta,
String[] optNames)
Constructs an instance where all the default inclusion flags are true and a null value is not permitted. |
Method Summary | |
---|---|
Specifier<boolean[]> |
createSpecifier()
Constructs a graphical control with which the user can specify a suitable value for association with this key. |
int |
optCharToIndex(char c)
Gets the option index from an initial character. |
char |
optIndexToChar(int io)
Gets the initial letter from the option index. |
boolean[] |
stringToValue(String txt)
Decodes a string value to the value type of this key. |
String |
valueToString(boolean[] opts)
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 |
---|
public CombinationConfigKey(ConfigMeta meta, boolean[] dflt, String[] optNames, String nullLabel)
meta
- metadatadflt
- default array of selection flagsoptNames
- labels for each of the options that may be selected,
same length as dflt
nullLabel
- label for a specifer option indicating the null
value; null is a permitted value only if this
parameter is non-nullpublic CombinationConfigKey(ConfigMeta meta, String[] optNames)
meta
- metadataoptNames
- labels for each of the options that may be selected,Method Detail |
---|
public boolean[] stringToValue(String txt) throws ConfigException
ConfigKey
stringToValue
in class ConfigKey<boolean[]>
txt
- string representation of value
ConfigException
public String valueToString(boolean[] opts)
ConfigKey
stringToValue(valueToString(v)).equals(v)
.
A null value, if permitted, should be represented as an empty string.
valueToString
in class ConfigKey<boolean[]>
opts
- possible value associated with this key
public Specifier<boolean[]> createSpecifier()
ConfigKey
createSpecifier
in class ConfigKey<boolean[]>
public int optCharToIndex(char c) throws ConfigException
c
- label character, case unimportant
ConfigException
- if no index is indicated (unknown letter)public char optIndexToChar(int io)
io
- option index
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |