-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathZipCodeWilmington.java
More file actions
37 lines (27 loc) · 1.07 KB
/
ZipCodeWilmington.java
File metadata and controls
37 lines (27 loc) · 1.07 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
package io.zipcoder.interfaces;
import interfaces.Teacher;
import java.util.HashMap;
import java.util.Map;
public final class ZipCodeWilmington {
private static final ZipCodeWilmington INSTANCE = new ZipCodeWilmington();
private static Students students = Students.getInstance();
private static Instructors instructors = Instructors.getInstance();
private static Map<Student, Double> studyMap;
public static ZipCodeWilmington getInstance(){
return INSTANCE;
}
// static so it can be accessed directly
public static void hostLecture(Teacher teacher, double numberOfHours){
teacher.lecture(students.toArray(),numberOfHours);
}
public static void hostLecture(long id, double numberOfHours){
instructors.findById(id).lecture(students.toArray(),numberOfHours);
}
public static Map<Student,Double> getStudyMap(){
studyMap = new HashMap<Student, Double>();
for (Student eachStudent : students){
studyMap.put(eachStudent,eachStudent.getTotalStudyTime());
}
return studyMap;
}
}