|
||||||||
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 |
|
ClassPeriod(String name,
int num,
String fileName)
Constructor that takes the teacher's name, period number, and a file name that contains the student information |
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 teacherpublic ClassPeriod(String name, int num)
name
- the name for the teachernum
- the period numberpublic ClassPeriod(String name, int num, String fileName)
name
- the name for the teachernum
- the period numberfileName
- the name of the file with the student
informationMethod 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 Object
public 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 |