public class Settings extends Object
When specified in the command line Settings may sometimes be set with just the keyword. This is treated as equivalent to key=1.
Modifier and Type | Method and Description |
---|---|
static void |
add(String key,
String value)
Add a setting to a list -- but only if it is
not already in the list.
|
static void |
addArgs(String[] args)
Add settings from a list of arguments.
|
static void |
addToken(String arg)
Add a single argument token
|
static String |
get(String key)
Get a value corresponding to the key
|
static String |
get(String key,
String dft)
Get a values corresponding to a key or the default
|
static String[] |
getArray(String key)
Get the values corresponding to a key as an array of strings.
|
static String[] |
getKeys()
Return the array of keys in the current settings
|
static boolean |
has(String key)
Check if the given key has been set
|
static HashMap<String,String> |
pop()
Give a copy of the current settings and pop the stack
|
static void |
push(HashMap<String,String> top) |
static void |
put(String key,
String value)
Save a key and value
|
static void |
restore()
Restore a previously saved state.
|
static void |
save()
Save the current state of the settings for a later restoration
|
static void |
suggest(String key,
String value)
This method works like put except that
it does not add a pair if the keys is in the _nullvalues setting
or if the Setting is already set (unless it is set to the
special value "default")
|
static void |
updateFromFile(String settingsFile)
Try to read settings from a file
|
public static void updateFromFile(String settingsFile)
public static void addArgs(String[] args)
public static void addToken(String arg)
public static String get(String key, String dft)
public static String[] getArray(String key)
public static void suggest(String key, String value)
public static void save()
public static void add(String key, String value)
public static boolean has(String key)
public static String[] getKeys()
public static void restore()
public static HashMap<String,String> pop()