private static String formatSections(List<Section> sections) { int open = 0; for (final Section section : sections) { if (section.isOpen()) { open++; } } return open + " / " + sections.size(); }
/** * Add a collection of courses to the courses list. * * @param courses Courses to add */ public void addAllCourses(Collection<Course> courses) { synchronized (mLock) { for (final Course course : courses) { Iterator<Section> i = course.getSections().iterator(); while (i.hasNext()) { final Section section = i.next(); if (!section.getPrinted().equals("Y")) { i.remove(); } } if (!course.getSections().isEmpty()) { mCourseSection.add(course); } } } notifyDataSetChanged(); }