|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectClassPeriod
public class ClassPeriod
ClassPeriod represents a class period which has a teacher, a period number, and an array of students (max 35)
| Constructor Summary | |
|---|---|
ClassPeriod()
No-argument constructor. |
|
ClassPeriod(String name)
Constructor that takes just the teacher's name |
|
ClassPeriod(String name,
int num)
Constructor that takes the teacher's name and period number |
|
| Method Summary | |
|---|---|
int |
getNumStudents()
Method to return the number of students in the period |
int |
getPeriodNumber()
Method to get the period number |
Student |
getStudent(int index)
Method to get a student based on the index |
String |
getTeacherName()
Method to get the teacher's name |
static void |
main(String[] args)
Main method |
boolean |
setPeriodNumber(int num)
Method to set the period number (if it hasn't been set) |
void |
setStudent(Student studentObj,
int index)
Method to set the student at an index |
void |
setTeacherName(String name)
Method to set the teacher's name |
String |
toString()
Method to return a string of information about this class period |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ClassPeriod()
public ClassPeriod(String name)
name - the name for the teacher
public ClassPeriod(String name,
int num)
name - the name for the teachernum - the period number| Method Detail |
|---|
public String getTeacherName()
public int getPeriodNumber()
public Student getStudent(int index)
public void setTeacherName(String name)
name - the name to usepublic boolean setPeriodNumber(int num)
num - the number to use
public void setStudent(Student studentObj,
int index)
studentObj - the student object to useindex - the index to set the student atpublic int getNumStudents()
public String toString()
toString in class Objectpublic static void main(String[] args)
args - the arguments to execution
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||