0

Here is the Method where i get the Multiple List From different URL and then sort different List into a single ArrayList. Arraylist from different calendar has different EMAIL and OWNER NAME. In this method i am returning only a single ArrayList. how to get the EMAIL and OWNNER NAME of Each ArrayList?.

public List<ArrayList> getEventsSort(Filter filter, String uri, Sardine sardine,
    List<String> emailShare) throws IOException, ParserException {
List eventsToday = null;
List arrayList = new ArrayList<String>();
for (String email : emailShare) {
    String uris = uri + email + "/events/";
    InputStream stream = null;
    try {
        stream = sardine.get(uris);
        BufferedReader br = new BufferedReader(new InputStreamReader(
                stream));
        CalendarBuilder builder = new CalendarBuilder();
        net.fortuna.ical4j.model.Calendar calendar = builder.build(br);
        eventsToday = (List<?>) filter.filter(calendar
                .getComponents(Component.VEVENT));  
        arrayList.addAll(eventsToday);
    } finally {
        IOUtils.closeQuietly(stream);
    }
}

    getSortList(arrayList);
return arrayList;

}

VICKY-TSC
  • 405
  • 2
  • 5
  • 19
  • Lots of irrelevant stuff. Face the problem and help us face it. – d1e Jun 21 '12 at 08:48
  • You mean when you return your list of lists you then cannot distinguish which list belongs to who? Don't use lists then. Create proper model class like Calendar with fields owner, email, events; and return list of these objects instead. – maksimov Jun 21 '12 at 08:48
  • Yes Same as @Maksimov has explained. – VICKY-TSC Jun 21 '12 at 08:51

1 Answers1

1

you can do this by creating an array list of class objects that store 3 variables (email, source name and source email ID)

Vedant Agarwala
  • 18,146
  • 4
  • 66
  • 89