| java.lang.Object gnu.text.Options
Options | public class Options (Code) | | Mananges a table of named options,
Can inherit from another table of "default" options.
|
Method Summary | |
public void | add(String key, int kind, String documentation) Create a new option and enters it in this table.
A duplicate option throws a RuntimeException.
Parameters: key - the options name (key). Parameters: kind - type and other flag bits of the option. Parameters: documentation - a String describing what the option does. | public Object | get(String key, Object defaultValue) 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. | public boolean | getBoolean(String key) | public boolean | getBoolean(String key, boolean defaultValue) | public String | getDoc(String key) | public OptionInfo | getInfo(String key) | public Object | getLocal(String key) Get current option value. | public Vector | keys() Return the list of option keys. | public void | popOptionValues(Vector options) | public void | pushOptionValues(Vector options) Set a list of options, remember the old value. | public void | reset(String key, Object oldValue) Reset the value of a named option. | public void | set(String key, Object value) Set the value of a named option. | public void | set(String key, Object value, SourceMessages messages) Set the value of a named option. | public String | set(String key, String argument) 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. | static Object | valueOf(OptionInfo info, String argument) |
BOOLEAN_OPTION | final public static int BOOLEAN_OPTION(Code) | | Bit indicating option value is a boolean.
|
STRING_OPTION | final public static int STRING_OPTION(Code) | | |
previous | Options previous(Code) | | The option table contain defaults, that we "inherit" from.
|
valueTable | Hashtable valueTable(Code) | | Maps property keys to options values.
|
add | public void add(String key, int kind, String documentation)(Code) | | Create a new option and enters it in this table.
A duplicate option throws a RuntimeException.
Parameters: key - the options name (key). Parameters: kind - type and other flag bits of the option. Parameters: documentation - a String describing what the option does. |
get | public Object get(String key, Object defaultValue)(Code) | | 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.
|
getBoolean | public boolean getBoolean(String key, boolean defaultValue)(Code) | | |
getLocal | public Object getLocal(String key)(Code) | | 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 except on an unknonw option).
|
keys | public Vector keys()(Code) | | Return the list of option keys.
|
popOptionValues | public void popOptionValues(Vector options)(Code) | | Restore a list of options, as set by pushOptionValues
|
pushOptionValues | public void pushOptionValues(Vector options)(Code) | | 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 valus is ignores and is used to store the old value; anda new value for the options. |
reset | public void reset(String key, Object oldValue)(Code) | | Reset the value of a named option.
|
set | public String set(String key, String argument)(Code) | | 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.
|
|
|