mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-28 05:35:34 +00:00
(Android) Add getFloat/setFloat to ConfigFile.java
This commit is contained in:
parent
b6539dc879
commit
23faaba1f1
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user