public final class Configuration
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Configuration.ConfigChangeListener
An interface used to send notifications of a changed configurations
setting.
|
Modifier and Type | Method and Description |
---|---|
static void |
addListener(Configuration.ConfigChangeListener listener) |
static void |
checkForConfigurationAndWriteDefaults()
Checks if there is a configuration file there and, if not, writes the
default configuration parameters to the configuration file.
|
static java.lang.String |
get(ConfKey key)
Read the configuration for a certain key.
|
static boolean |
getBoolean(ConfKey key)
Parses a configured string as a boolean.
|
static java.lang.String |
getDescription(ConfKey key)
Read the description name for a certain key.
|
static double |
getDouble(ConfKey key)
Read the configuration for a certain key.
|
static java.io.File |
getFile(ConfKey key) |
static java.lang.String |
getHumanName(ConfKey key)
Read the human name for a certain key.
|
static int |
getInt(ConfKey key)
Read the configured Integer for a certain key.
|
static java.util.List<java.lang.String> |
getList(ConfKey key)
Return a list of values stored with a key
|
static PitchDetectionMode |
getPitchDetectionMode(ConfKey key)
Return a configured PitchDetectionMode
|
static void |
set(ConfKey key,
java.lang.Object value)
Delegates to either the set(String) method or setList method to store
strings or lists respectively.
|
static void |
set(ConfKey key,
java.lang.String value)
Set a configuration parameter.
|
public static java.lang.String get(ConfKey key)
key
- the configuration keypublic static java.lang.String getHumanName(ConfKey key)
key
- the configuration keypublic static java.lang.String getDescription(ConfKey key)
key
- the configuration keypublic static int getInt(ConfKey key)
key
- The configuration key.java.lang.NumberFormatException
- If the configured value can not be parsed to an integer a
is thrown.public static double getDouble(ConfKey key)
key
- The configuration key.public static boolean getBoolean(ConfKey key)
Example: Boolean.parseBoolean("True")
returns
true
.
Example: Boolean.parseBoolean("yes")
returns
false
.
key
- the name of the configuration parametertrue
if the configured value is not null and is
equal, ignoring case, to the string "true", false
otherwise.public static PitchDetectionMode getPitchDetectionMode(ConfKey key)
key
- the key of the configured valuepublic static void checkForConfigurationAndWriteDefaults()
public static void set(ConfKey key, java.lang.String value)
key
- the keyvalue
- the valuepublic static java.util.List<java.lang.String> getList(ConfKey key)
key
- The key.public static void addListener(Configuration.ConfigChangeListener listener)
listener
- public static void set(ConfKey key, java.lang.Object value)
key
- value
- public static java.io.File getFile(ConfKey key)