Package org.nm.ntutimetabletoics

Examples of org.nm.ntutimetabletoics.Course


    private void initSemesterTimetable(net.htmlparser.jericho.Element div,
            SemesterTimetable sT) {
        List<net.htmlparser.jericho.Element> rows =
                div.getAllElements(HTMLElementName.TR);
        Iterator<net.htmlparser.jericho.Element> rowIt = rows.iterator();
        Course course = null;
        int rowNo = 0;
        while (rowIt.hasNext()) {
            div = rowIt.next();
            List<net.htmlparser.jericho.Element> cols = div.getChildElements();
            if (rowNo == 0) { // header row
View Full Code Here


            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;
                }
View Full Code Here

*/
public class ClassVEvent extends VEvent {

    public ClassVEvent(ClassTimetable ct) {
        super();
        Course course = ct.getCourse();
        PropertyList pl = getProperties();
        DateTime[] timeStandard = ct.getDtStartEnd();
        pl.add(new DtStart(timeStandard[0]));
        if (timeStandard[1] != null) {
            pl.add(new DtEnd(timeStandard[1]));
        }
        try {
            UidGenerator ug = new UidGenerator("1");
            pl.add(ug.generateUid());
        } catch (SocketException ex) {
            Logger.getLogger(ClassVEvent.class).error(
                    "Error when assigning UID to "
                    + course.getCourseName() + " class timetable ", ex);
        }
        pl.add(new Description(course.getCourseName() + "("
                + course.getIndexNum() + ", " + ct.getGroup() + ")\n"
                + course.getCourseType()
                + (course.getCourseType().isPrescribed()
                ? " " + course.getGeneralPEType() : "")));
        pl.add(new Location(ct.getVenue()));
        pl.add(new Summary(course.getCourseName() + " " + ct.getClassType()
                + " " + ct.getRemark()));
        String[] split = ct.getSemesterTimetable().getStartExam().split("-");
        String str = split[0] + split[1] + split[2];
        try {
            pl.add(new RRule(new Recur(Recur.WEEKLY, new Date(str))));
        } catch (ParseException ex) {
            Logger.getLogger(ClassVEvent.class).error("Error when parsing "
                    + "recurrence rule for " + course.getCourseName()
                    + " class timetable", ex);
        }
    }
View Full Code Here

            assertSame(result, resultST.getNtuTimetable());
            ArrayList<Course> cList = resultST.getCourses();
            assertNotNull(cList);
            int m = cList.size();
            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());
                }
            }
View Full Code Here

TOP

Related Classes of org.nm.ntutimetabletoics.Course

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.