/** * Adds a student to the classlist when there is enough slot * * @param stdNum * @return true if the student was successfully added */ public boolean addStudent(String stdNum) { if (students.size() < section.getClassSize()) { if (!students.containsKey(stdNum)) { students.put(stdNum, stdNum); return true; } else { return false; } } return false; }
/** * Returns true if the classlist is full * * @return true if the classlist is full */ public boolean full() { return (students.size() == section.getClassSize()); }