private List<Tweet> tweets;
private static final long serialVersionUID = -9059136565234613286L;
/*package*/ QueryResult(Response res, TwitterSupport twitterSupport) throws TwitterException {
super(res);
JSONObject json = res.asJSONObject();
try {
sinceId = json.getLong("since_id");
maxId = json.getLong("max_id");
refreshUrl = getString("refresh_url", json, true);
resultsPerPage = json.getInt("results_per_page");
warning = getString("warning", json, false);
completedIn = json.getDouble("completed_in");
page = json.getInt("page");
query = getString("query", json, true);
JSONArray array = json.getJSONArray("results");
tweets = new ArrayList<Tweet>(array.length());
for (int i = 0; i < array.length(); i++) {
JSONObject tweet = array.getJSONObject(i);
tweets.add(new Tweet(tweet, twitterSupport));
}
} catch (JSONException jsone) {
throw new TwitterException(jsone.getMessage() + ":" + json.toString(), jsone);
}