这是我从不同URL获取多个列表的方法,然后将不同的列表排序到单个ArrayList中。来自不同日历的数组列表具有不同的电子邮件和所有者名称。在此方法中,我只返回一个数组列表。如何获取每个数组列表的电子邮件和 OWNNER 名称?
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;
}
您可以通过
创建存储 3 个变量(电子邮件、源名称和源电子邮件 ID)的类对象的数组列表来执行此操作