Package org.nm.ntutimetabletoics

Examples of org.nm.ntutimetabletoics.ClassTimetable


    }

    private Course initCourse(SemesterTimetable sT, Course course,
            Iterator<net.htmlparser.jericho.Element> colIt) {
        int colNo = 0;
        ClassTimetable clst = null;
        while (colIt.hasNext()) {
            net.htmlparser.jericho.Element cell = colIt.next();
            String txt = cell.getTextExtractor().toString();
            boolean emptyString = txt == null || txt.trim().isEmpty();
            if (colNo == 0) {
                if (emptyString) {
                    sameCourse = true;
                } else {
                    course = new Course(sT);
                    sT.getCourses().add(course);
                    ntuTimetable.getCourses().add(course);
                    Setter.set(course, header[colNo], txt.trim());
                    sameCourse = false;
                }
                clst = new ClassTimetable(course, sT);
            } else {
                if (!emptyString) {
                    String trimmed = txt.trim();
                    if (!sameCourse) {
                        Setter.set(course, header[colNo], trimmed);
                    }
                    Setter.set(clst, header[colNo], trimmed);
                }
            }
            ++colNo;
        }
        ntuTimetable.getClassTimetables().add(clst);
        sT.getClassTimetables().add(clst);
        clst.calculateStartDate();
        course.getClassTimetables().add(clst);
        return course;
    }
View Full Code Here


        ComponentList cl = getComponents();
        pl.add(new ProdId("-//Nia Mutiara//NTU Timetable to iCalendar//EN"));
        pl.add(Version.VERSION_2_0);
        pl.add(CalScale.GREGORIAN);
        Iterator<ClassTimetable> it = st.getClassTimetables().iterator();
        ClassTimetable ct;
        while (it.hasNext()) {
            ct = it.next();
            cl.add(ct.toEvent());
        }
        if (st.hasRecess()) {
            //System.out.println(st.getRecessEvent());
            cl.add(st.getRecessEvent());
        }
View Full Code Here

            for (int j = 0; j < m; ++j) {
                Course c = cList.get(j);
                System.out.println(c.getCourseName());
                ArrayList<ClassTimetable> clList = c.getClassTimetables();
                for (int k = 0; k < clList.size(); ++k) {
                    ClassTimetable cp = clList.get(k);
                    System.out.println(cp.getClassType());
                }
            }
            System.out.println("\n------------\n");
            ArrayList<ClassTimetable> clList = resultST.getClassTimetables();
            assertSame(resultST.getClassTimetables(), clList);
            for (int j = 0; j < clList.size(); ++j) {
                ClassTimetable c = clList.get(j);
                //System.out.println(c.getClassType());
            }
            assertNotNull(resultST.getClassTimetables());
        }
    }
View Full Code Here

TOP

Related Classes of org.nm.ntutimetabletoics.ClassTimetable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.