Package gnu.text
Class Options
java.lang.Object
gnu.text.Options
Mananges a table of named options,
Can inherit from another table of "default" options.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBit indicating option value is a boolean.static final intstatic final intstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a new option and enters it in this table.static BooleanbooleanValue(String argument) get(Options.OptionInfo key) get(Options.OptionInfo key, Object defaultValue) Get the value for the option.booleanbooleangetBoolean(Options.OptionInfo key, boolean defaultValue) booleangetBoolean(String key) booleangetBoolean(String key, boolean defaultValue) intgetInt(Options.OptionInfo key, int defaultValue) Get current option value.keys()Return the list of option keys.voidpopOptionValues(Vector options) Restore a list of options, as set by pushOptionValuesvoidpushOptionValues(Vector options) Set a list of options, remember the old value.voidReset the value of a named option.voidSet the value of a named option.set(String key, Object value, SourceMessages messages) Set the value of a named option.Set the value of the key to the argument, appropriate parsed.
-
Field Details
-
BOOLEAN_OPTION
public static final int BOOLEAN_OPTIONBit indicating option value is a boolean.- See Also:
-
STRING_OPTION
public static final int STRING_OPTION- See Also:
-
INT_OPTION
public static final int INT_OPTION- See Also:
-
UNKNOWN
- See Also:
-
-
Constructor Details
-
Options
public Options() -
Options
-
-
Method Details
-
add
Create a new option and enters it in this table. A duplicate option throws a RuntimeException.- Parameters:
key- the options name (key).kind- type and other flag bits of the option.documentation- a String describing what the option does.
-
add
-
booleanValue
-
set
Set the value of a named option. -
set
Set the value of a named option. Return old value, in form suitable for reset. -
reset
Reset the value of a named option. -
set
Set the value of the key to the argument, appropriate parsed. return null on success or a String error message. If the option key is invalid, return UNKNOWN. -
getInfo
-
get
Get the value for the option. Throws an except if there is no option by that name, Returns defaultValue if there is such an option, but it hasn't been set. -
get
-
get
-
getLocal
Get current option value. Only look in local table, not in inherited Options. Return null if there is no binding (even when get would throw an exception on an unknown option). -
getBoolean
-
getBoolean
-
getBoolean
-
getBoolean
-
getInt
-
pushOptionValues
Set a list of options, remember the old value.- Parameters:
options- is vector of triples, echo of which is consisting of: a String option key; an entry whose value is ignored and is used to store the old value; and a new value for the option.
-
popOptionValues
Restore a list of options, as set by pushOptionValues -
keys
Return the list of option keys. -
getDoc
-