projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib: Add 'gauss' units for magnetic field strength
[fw/altos]
/
altoslib
/
AltosPreferencesBackend.java
diff --git
a/altoslib/AltosPreferencesBackend.java
b/altoslib/AltosPreferencesBackend.java
index 9131ad39b5d0c72190c5e7967bfa6a2814675a0f..559cff07a057412b2b98e19fd312769c61b3793b 100644
(file)
--- a/
altoslib/AltosPreferencesBackend.java
+++ b/
altoslib/AltosPreferencesBackend.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-15,7
+16,7
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_1
1
;
+package org.altusmetrum.altoslib_1
3
;
import java.io.*;
import java.util.*;
import java.io.*;
import java.util.*;
@@
-38,16
+39,20
@@
public abstract class AltosPreferencesBackend {
public abstract byte[] getBytes(String key, byte[] def);
public abstract void putBytes(String key, byte[] value);
public abstract byte[] getBytes(String key, byte[] def);
public abstract void putBytes(String key, byte[] value);
- public Altos
HashSet getHashSet
(String key) {
+ public Altos
Json getJson
(String key) {
String value = getString(key, null);
if (value == null)
return null;
String value = getString(key, null);
if (value == null)
return null;
- return AltosHashSet.fromString(value);
+ try {
+ return AltosJson.fromString(value);
+ } catch (IllegalArgumentException ie) {
+ return null;
+ }
}
}
- public void put
HashSet(String key, AltosHashSet h
) {
- putString(key,
h
.toString());
+ public void put
Json(String key, AltosJson j
) {
+ putString(key,
j
.toString());
}
public abstract boolean nodeExists(String key);
}
public abstract boolean nodeExists(String key);