public static Location constructCounts(Response res) throws WeiboException { try { JSONArray list = (JSONArray) res.asJSONObject().get("geos"); return new Location(list.getJSONObject(0)); } catch (JSONException jsone) { throw new WeiboException(jsone); } catch (WeiboException te) { throw te; } }
static List<Count> constructCounts(Response res) throws WeiboException { try { System.out.println(res.asString()); JSONArray list = res.asJSONArray(); int size = list.length(); List<Count> counts = new ArrayList<Count>(size); for (int i = 0; i < size; i++) { counts.add(new Count(list.getJSONObject(i))); } return counts; } catch (JSONException jsone) { throw new WeiboException(jsone); } catch (WeiboException te) { throw te; } }