예제 #1
0
  /**
   * Initialize your schedule by coding it directly in. This is the schedule that will appear on the
   * map when you select "Show My Schedule".
   */
  private void initializeMySchedule() {
    // CPSC 210 Students; Implement this method
    me = new Student("Zhou", "Xue Wen", 17013129);
    // Schedule mySchedule = me.getSchedule();
    studentManager = new StudentManager();
    studentManager.addStudent("Zhou", "Xue Wen", 17013129);
    studentManager.addSectionToSchedule(17013129, "CPSC", 210, "202");
    studentManager.addSectionToSchedule(17013129, "JAPN", 100, "022");
    studentManager.addSectionToSchedule(17013129, "MATH", 302, "201");
    // studentManager.addSectionToSchedule(17013129,"CRWR",209,"002");
    //        Course cpsc210 = CourseFactory.getInstance().getCourse("CPSC", 210);
    //        Course japn100 = CourseFactory.getInstance().getCourse("JAPN", 100);
    //        Course math302 = CourseFactory.getInstance().getCourse("MATH", 302);
    //        //Course crwr209 = CourseFactory.getInstance().getCourse("CRWR", 209);
    //        //mySchedule.add(crwr209.getSection("002"));
    //        mySchedule.add(cpsc210.getSection("202"));
    //        mySchedule.add(japn100.getSection("022"));
    //        mySchedule.add(math302.getSection("201"));

  }
예제 #2
0
 /**
  * Called when the parsing of an element starts. (e.g., <book>)
  *
  * <p>Lookup documentation to learn meanings of parameters.
  */
 @Override
 public void startElement(String namespaceURI, String localName, String qName, Attributes atts) {
   if (qName.toLowerCase().equals("section")) {
     studentId = atts.getValue("StudentId");
     sectName = atts.getValue("name");
     sectCourseCode = atts.getValue("courseCode");
     sectCourseNumber = atts.getValue("courseNumber");
     if (studentId != null
         && sectName != null
         && sectCourseNumber != null
         && sectCourseCode != null)
       manager.addSectionToSchedule(
           Integer.parseInt(studentId),
           sectCourseCode,
           Integer.parseInt(sectCourseNumber),
           sectName);
   }
   accumulator.setLength(0);
 }