|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.hogent.tarsos.util.Configuration
public final class Configuration
Utility class to access (read and write) configuration settings. There are utility methods for booleans, doubles and integers. It automatically converts directory separators with the correct file separator for the current operating system.
Nested Class Summary | |
---|---|
static interface |
Configuration.ConfigChangeListener
An interface used to send notifications of a changed configurations setting. |
Method Summary | |
---|---|
static void |
addListener(Configuration.ConfigChangeListener listener)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String get(ConfKey key)
key
- the configuration key
public static java.lang.String getHumanName(ConfKey key)
key
- the configuration key
public static java.lang.String getDescription(ConfKey key)
key
- the configuration key
public 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 parameter
true
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 value
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |