int counter = 0;
try {
for (int page = 1, max = (int) Math.ceil((double) this.config.resultCount / Configuration.ENTRIES_PER_PAGE); this.loop && page <= max; page++) {
final String content = this.getContent(page);
final JSObject model = JSONParser.parse(content);
try {
JSObject searchResult =
model.get(this.config.opName + "Response").get("searchResult");
final int count = (page == max)
? ((this.config.resultCount - 1) % Configuration.ENTRIES_PER_PAGE) + 1
: Integer.parseInt(searchResult.get("@count").toString());
for (int i = 0; this.loop && i < count; i++) {
counter++;
JSObject item = searchResult.get("item").get(i);
auctions.add(new Auction(item));
}
}
catch (NullPointerException e) {
// ignore...