further normalization of the data API

This commit is contained in:
Ben Fry
2013-04-28 13:20:56 -04:00
parent fe8690844f
commit 4fd831fb89
6 changed files with 1134 additions and 131 deletions

View File

@@ -145,6 +145,30 @@ public class JSONArray {
}
public JSONArray(IntList list) {
myArrayList = new ArrayList<Object>();
for (int item : list.values()) {
myArrayList.add(new Integer(item));
}
}
public JSONArray(FloatList list) {
myArrayList = new ArrayList<Object>();
for (float item : list.values()) {
myArrayList.add(new Float(item));
}
}
public JSONArray(StringList list) {
myArrayList = new ArrayList<Object>();
for (String item : list.values()) {
myArrayList.add(item);
}
}
/**
* Construct a JSONArray from a source JSON text.
* @param source A string that begins with