Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. import java.io.Serializable;
  2. import java.util.*;
  3.  
  4. public class Group implements Serializable{
  5. private final int groupNum;
  6. private final String groupName;
  7.  
  8. public Group(int groupNum, String gName) {
  9. this.groupNum = groupNum;
  10. this.students = new HashMap<Student, Boolean>();
  11. this.groupName = gName;
  12. }
  13.  
  14.  
  15. public String getGroupName() {
  16.  
  17. return groupName;
  18. }
  19.  
  20. public int getGroupNum() { return groupNum; }
  21.  
  22. public HashMap<Student, Boolean> getStudents() {
  23. return students;
  24. }
  25.  
  26. public void setStudents(HashMap<Student, Boolean> students) {
  27. this.students = students;
  28. }
  29.  
  30. @Override
  31. public String toString() {
  32. return "Group{" +
  33. "groupNum=" + groupNum +
  34. ", groupName='" + groupName + '\'' +
  35. ", students=" + students.toString() +
  36. '}';
  37. }
  38.  
  39. private HashMap<Student, Boolean> students = new HashMap<>();
  40. public void addStudent(Student student){
  41. students.put(student, false);
  42. }
  43. public void removeStudent(Student student){
  44. students.remove(student);
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement