Package edu.pdx.cs.joy.jdbc
Class Course
java.lang.Object
edu.pdx.cs.joy.jdbc.Course
Represents a course in a college course catalog.
Each course has a unique ID, a title, is associated with a department, and has a number of credits.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns the number of credits for this course.intReturns the department ID for this course.intgetId()Returns the unique ID of this course.getTitle()Returns the title of this course.inthashCode()voidsetCredits(int credits) Sets the number of credits for this course.voidsetDepartmentId(int departmentId) Sets the department ID for this course.voidsetId(int id) Sets the unique ID of this course.voidSets the title of this course.toString()
-
Constructor Details
-
Course
Creates a new Course with the specified title, department ID, and credits.- Parameters:
title- the title of the coursedepartmentId- the numeric ID of the department offering this coursecredits- the number of credits for this course
-
Course
public Course()Creates a new Course with no initial values. Useful for frameworks that use reflection.
-
-
Method Details
-
getId
Returns the unique ID of this course.- Returns:
- the course ID
-
setId
Sets the unique ID of this course.- Parameters:
id- the course ID
-
getTitle
Returns the title of this course.- Returns:
- the course title
-
setTitle
Sets the title of this course.- Parameters:
title- the course title
-
getDepartmentId
Returns the department ID for this course.- Returns:
- the department ID
-
setDepartmentId
Sets the department ID for this course.- Parameters:
departmentId- the department ID
-
getCredits
Returns the number of credits for this course.- Returns:
- the number of credits
-
setCredits
Sets the number of credits for this course.- Parameters:
credits- the number of credits
-
toString
-
equals
-
hashCode
-