-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathZipCodeWilmington.java
More file actions
41 lines (27 loc) · 1.02 KB
/
ZipCodeWilmington.java
File metadata and controls
41 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package io.zipcoder.interfaces;
import java.util.HashMap;
import java.util.Map;
public final class ZipCodeWilmington {
private static final ZipCodeWilmington INSTANCE = new ZipCodeWilmington();
private static final Students students = Students.getInstance();
private static final Instructors instructors = Instructors.getInstance();
private ZipCodeWilmington() {
}
public void hostLecture(Teacher teacher, double numberOfHours) {
teacher.lecture(students.toArray(), numberOfHours);
}
public void hostLecture(long id, double numberOfHours) {
Teacher teacher = (Instructor) instructors.findById(id);
teacher.lecture(students.toArray(), numberOfHours);
}
public Map getStudyMap() {
Map<Student, Double> timeMap = new HashMap<Student, Double>();
for (Student s : students) {
timeMap.put(s, s.getTotalStudyTime());
}
return timeMap;
}
public static ZipCodeWilmington getInstance() {
return INSTANCE;
}
}