java - Multiple ArrayList with 10 records using iterator and ArrayList -
mutliple arraylist<> 10 records. have used limiting upto 10 results , how next 10 results , on.
try { arraylist<calanderqueryoutput> results = new arraylist<calanderqueryoutput>(); list<?> eventstoday = (list<?>) filter.filter(calendar.getcomponents(component.vevent)); calanderqueryoutput caldavoutput = new calanderqueryoutput(); (iterator<?> = eventstoday.iterator(); i.hasnext();) { if(limit < rslimit){ results.add(caldavoutput); limit++; } } }
first of need other data strcuture store multiple arraylists, can use list of list
list<list<calanderqueryoutput>> resultlist = new arraylist<list<calanderqueryoutput>>(); list<calanderqueryoutput> results = new arraylist<calanderqueryoutput>(); (iterator<?> = eventstoday.iterator(); i.hasnext();) { if(limit < rslimit){ results.add(caldavoutput); limit++; }else{ resultlist.add(results); limit = 0; results = new arraylist<calanderqueryoutput>(); } } }
Comments
Post a Comment