diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User$1.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User$1.class index ea10330b84f1bb333ab75538ba02d47dc25da6d7..e670893a3f971cc49ca79dfcacba893be8f28dac 100644 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User$1.class and b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User$1.class differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User.class index a5576f489867ce1c3a3faf48dfe3588f25bcdb39..9fd758cce3f9e6d4fa9b3b5f5d9ab19574567162 100644 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User.class and b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User.class differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Course.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Course.class index e10a60c67eb37ac7a223fb1444b8d07339077b0e..091352545297b5b4097ec380507fc164aa1c43b9 100644 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Course.class and b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Course.class differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Timetable.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Timetable.class index 43f79ea357f926c5f9bc367e1f8f795c708a2070..ee4aab02b7cc367e7dbac1ddce92c2144a3caf3c 100644 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Timetable.class and b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Timetable.class differ diff --git a/src/Softeng/Group3/SiJadwal/actor/Student.java b/src/Softeng/Group3/SiJadwal/actor/Student.java index 520094960303970990ab20626a5d1f6299594bb5..63f07cc575b267b09cb955c696855653562109d8 100644 --- a/src/Softeng/Group3/SiJadwal/actor/Student.java +++ b/src/Softeng/Group3/SiJadwal/actor/Student.java @@ -6,7 +6,6 @@ import Softeng.Group3.SiJadwal.repository.CourseList; import Softeng.Group3.SiJadwal.repository.UserList; import java.sql.Time; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,30 +16,8 @@ public class Student extends Role { private CourseList courseList = new CourseList(); - // Timetable list - private static List<Timetable> timetableList = new ArrayList<>(); - - private List<Timetable> getTimetableList() { - return timetableList; - } - - private Timetable getTimetable(String timetableName){ - for (Timetable timetable: timetableList){ - if (timetable.getTimetableName().equalsIgnoreCase(timetableName)){ - return timetable; - } - } - return null; - } - - private void listToString(List<Timetable> timetableList){ - int i = 1; - for (Timetable timetable: timetableList) { - System.out.println(i + ". " + timetable.getTimetableName()); - i++; - } - } +// Al Taaj nanti lu pindahin ini list ke class Student yak @Override public void exclusiveActions() { @@ -53,19 +30,17 @@ public class Student extends Role { @Override public void doExclusiveActions(int userAction) { - courseOptions = listToHashmap(courseList.getCourseList()); - switch (userAction){ case 6: -// List<Course> courses = new ArrayList<>(); + System.out.println("Create a new timetable"); System.out.println("==============================="); System.out.println("Timetable Name?"); timetableName = in.next(); - Timetable newTimetable = new Timetable(timetableName); + System.out.println("Pick some courses to add (Comma separated): "); courseList.listToString(courseList.getCourseList()); String[] coursesPicked = in.next().split(","); @@ -81,61 +56,11 @@ public class Student extends Role { int i = 1; for (Course c: newTimetable.getCourses()) { System.out.println(i++ + " " + c.getCourseName()); -// courses.add(c); } - -// newTimetable.setCourses(courses); - timetableList.add(newTimetable); break; case 7: - listToString(getTimetableList()); break; - - case 8: - try { - System.out.println("Add a course to a timetable"); - System.out.println("==============================="); - - System.out.println("Timetable Name?"); - timetableName = in.next(); - - System.out.println("Pick some courses to add (Comma separated): "); - courseList.listToString(courseList.getCourseList()); - coursesPicked = in.next().split(","); - System.out.println("Picked: "); - for (String s: coursesPicked) { - System.out.println(s + " " + courseList.getCourseList().get(Integer.parseInt(s) - 1).getCourseName()); - getTimetable(timetableName).addCourse( - courseList.getCourseList().get(Integer.parseInt(s) - 1)); - } - - System.out.println("Timetable created: "); - System.out.println(getTimetable(timetableName).getTimetableName()); - int j = 1; - for (Course c: getTimetable(timetableName).getCourses()) { - System.out.println(j++ + " " + c.getCourseName()); - } - break; - - } catch (NullPointerException e) { - System.out.println("Timetable not found"); - break; - } - - - case 9: - System.out.println("Find timetable by name: "); - try { - String timetableName = in.next(); - System.out.println(getTimetable(timetableName).getTimetableName()); - System.out.println("Courses: " + getTimetable(timetableName).getCourses().toString()); - break; - } catch (NullPointerException e) { - System.out.println("Timetable not found"); - break; - } - default: } } diff --git a/src/Softeng/Group3/SiJadwal/model/Course.java b/src/Softeng/Group3/SiJadwal/model/Course.java index 5b96c9ee23fc009a8226ed2cac6ad55feae1a758..b1d33382ff8cd22593dd0a59ed7ad35b1fc5bdf8 100644 --- a/src/Softeng/Group3/SiJadwal/model/Course.java +++ b/src/Softeng/Group3/SiJadwal/model/Course.java @@ -40,8 +40,8 @@ public class Course { this.endTime = endTime; } - @Override - public String toString() { - return courseName; - } +// private String startTime; +// private String endTime; + + } diff --git a/src/Softeng/Group3/SiJadwal/model/Timetable.java b/src/Softeng/Group3/SiJadwal/model/Timetable.java index c805a5688acb6d07b4e54985755eac0774c1247f..bc4c61bc0ee4363b07f4b38dfe4273c1edf4dcc0 100644 --- a/src/Softeng/Group3/SiJadwal/model/Timetable.java +++ b/src/Softeng/Group3/SiJadwal/model/Timetable.java @@ -1,17 +1,11 @@ package Softeng.Group3.SiJadwal.model; -import Softeng.Group3.SiJadwal.actor.Student; - import java.util.ArrayList; -import java.util.Date; import java.util.List; public class Timetable { private String timetableName; -// private Student owner; -// private Date startDate; -// private Date endDate; private static List<Course> courses = new ArrayList<>(); public Timetable(String timetableName) { @@ -37,30 +31,4 @@ public class Timetable { public void addCourse(Course course) { courses.add(course); } - -// public Date getStartDate() { -// return startDate; -// } -// -// public void setStartDate(Date startDate) { -// this.startDate = startDate; -// } -// -// public Date getEndDate() { -// return endDate; -// } -// -// public void setEndDate(Date endDate) { -// this.endDate = endDate; -// } - - -// public Student getOwner() { -// return owner; -// } -// -// public void setOwner() { -// this.owner = owner; -// } - }