public class Instructor
extends L5.Person
Constructor and Description |
---|
Instructor()
Creates an Instructor with name "undefined", Date of Birth of Jan 01, 1980, and an empty list of courses
|
Instructor(Instructor s)
Creates a "deep" copy of the instructor
|
Instructor(L5.Person p)
Creates an instructor from a "deep" copy of the person, with an empty list of courses
|
Instructor(java.lang.String name,
java.util.Date dob)
Creates an instructor with a name born on a specific date with an empty list of courses
|
Instructor(java.lang.String name,
java.util.Date dob,
java.util.List<java.lang.String> courses)
Creates an instructor with name, date of birth and a list of courses the instructor teaches
|
Modifier and Type | Method and Description |
---|---|
boolean |
addCourse(java.lang.String course)
Adds a course to the list of courses of the instructor
|
java.util.List<java.lang.String> |
getCourseList()
Returns the list of courses for the instructor
|
boolean |
removeCourse(java.lang.String course)
Removes a course from the list of courses of the instructor
|
java.lang.String |
toString()
Prints the instructor's name, date of birth, and the list of courses, line by line
|
public Instructor()
public Instructor(java.lang.String name, java.util.Date dob)
name
- dob
- public Instructor(java.lang.String name, java.util.Date dob, java.util.List<java.lang.String> courses)
name
- namedob
- date of birthcourses
- Courses which the instructor teachespublic Instructor(L5.Person p)
p
- existing personpublic Instructor(Instructor s)
s
- existing instructorpublic boolean addCourse(java.lang.String course)
course
- Course to be addedpublic boolean removeCourse(java.lang.String course)
course
- Course to be removedpublic java.util.List<java.lang.String> getCourseList()
public java.lang.String toString()
toString
in class L5.Person