private String query;
private List<Tweet> tweets;
private static final long serialVersionUID = -9059136565234613286L;
/*package*/ QueryResultJSONImpl(HttpResponse res, Configuration conf) throws TwitterException {
JSONObject json = res.asJSONObject();
try {
sinceId = getLong("since_id", json);
maxId = getLong("max_id", json);
refreshUrl = getUnescapedString("refresh_url", json);
resultsPerPage = getInt("results_per_page", json);
warning = getRawString("warning", json);
completedIn = getDouble("completed_in", json);
page = getInt("page", json);
query = getURLDecodedString("query", json);
JSONArray array = json.getJSONArray("results");
tweets = new ArrayList<Tweet>(array.length());
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.clearThreadLocalMap();
}
for (int i = 0; i < array.length(); i++) {
JSONObject tweet = array.getJSONObject(i);
tweets.add(new TweetJSONImpl(tweet, conf));
}
} catch (JSONException jsone) {
throw new TwitterException(jsone.getMessage() + ":" + json.toString(), jsone);
}