long candidateScore = candidateObj.getLong("score");
JSONObject candidateAttributes = candidateObj.getJSONObject("attributes");
double candidateX = candidateLocation.getDouble("x");
double candidateY = candidateLocation.getDouble("y");
StringAttributeMap attributes = new StringAttributeMap();
JSONArray names = candidateAttributes.names();
for (int n = 0; n < (names != null ? names.length() : 0); n++) {
String name = names.getString(n);
String value = candidateAttributes.getString(name);
attributes.add(new StringAttribute(name, value));
}