IMS-java/Code/Steiner/CO2-Daten-Projekt-V2/src/Teacher.java

52 lines
1.5 KiB
Java
Raw Normal View History

2024-11-06 15:41:49 +01:00
import java.util.HashMap;
import java.util.Map;
public class Teacher {
// #region Fields
2024-11-06 15:41:49 +01:00
private String name;
private Points points;
public static final Map<String, String> nameMap = new HashMap<>();
// #region Initialization
2024-11-06 15:41:49 +01:00
static {
2024-11-14 14:49:57 +01:00
// Mapping short names to full teacher names
2024-11-06 15:41:49 +01:00
nameMap.put("Hm", "Hummel");
nameMap.put("Bd", "Bender");
nameMap.put("Bu", "Burger");
nameMap.put("Cg", "Chung");
nameMap.put("Do", "Doe");
nameMap.put("Eh", "Ehrlich");
nameMap.put("Fh", "Fischer");
nameMap.put("Gi", "Giordano");
nameMap.put("Gr", "Graham");
nameMap.put("Hi", "Higgins");
nameMap.put("Kg", "Kang");
nameMap.put("Kh", "Khan");
nameMap.put("Lz", "Lozano");
nameMap.put("Lu", "Lund");
nameMap.put("Or", "Ortega");
nameMap.put("Re", "Reyes");
nameMap.put("Se", "Seng");
nameMap.put("Ts", "Tanaka");
nameMap.put("Vt", "Vetter");
nameMap.put("Zu", "Zuniga");
}
// #region Constructor
2024-11-06 15:41:49 +01:00
public Teacher(String name) {
2024-11-14 14:49:57 +01:00
// Use the short name to find the full name from the nameMap
2024-11-06 15:41:49 +01:00
this.name = nameMap.getOrDefault(name, "Unknown");
2024-11-14 14:49:57 +01:00
this.points = new Points(); // Initialize a new Points object
2024-11-06 15:41:49 +01:00
}
// #region Getters
2024-11-06 15:41:49 +01:00
public String getName() {
2024-11-14 14:49:57 +01:00
return name; // Return the teacher's full name
2024-11-06 15:41:49 +01:00
}
public Points getPoints() {
2024-11-14 14:49:57 +01:00
return points; // Return the Points object associated with this teacher
2024-11-06 15:41:49 +01:00
}
}