(Android) Add getFloat/setFloat to ConfigFile.java

This commit is contained in:
twinaphex 2013-08-24 16:37:04 +02:00
parent b6539dc879
commit 23faaba1f1

View File

@ -80,6 +80,10 @@ public class ConfigFile {
public void setDouble(String key, double value) {
map.put(key, Double.toString(value));
}
public void setFloat(String key, float value) {
map.put(key, Float.toString(value));
}
public boolean keyExists(String key) {
return map.containsKey(key);
@ -108,6 +112,14 @@ public class ConfigFile {
else
throw new NumberFormatException();
}
public float getFloat(String key) throws NumberFormatException {
String str = getString(key);
if (str != null)
return Float.parseFloat(str);
else
throw new NumberFormatException();
}
public boolean getBoolean(String key) {
String str = getString(key);