Package at.htl.timetableGenerator.model
Class WeeklySubject
java.lang.Object
at.htl.timetableGenerator.model.WeeklySubject
This class represents a subject that is taught a certain number of times per week.
A WeeklySubjects object is defined by a subject and the number of times it is taught per week.
-
Constructor Summary
ConstructorsConstructorDescriptionWeeklySubject(Subject subject, int noPerWeek) Constructs a new WeeklySubjects with the given subject and number of times it is taught per week. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the given object is equal to this WeeklySubjects.intReturns the number of times the subject is taught per week.Returns the subject that is taught.inthashCode()Returns a hash code value for this WeeklySubjects.voidsetNoPerWeek(int noPerWeek) Sets the number of times the subject is taught per week.voidsetSubject(Subject subject) Sets the subject that is taught.toString()Returns a string representation of this WeeklySubjects.
-
Constructor Details
-
WeeklySubject
Constructs a new WeeklySubjects with the given subject and number of times it is taught per week.- Parameters:
subject- The subject that is taught.noPerWeek- The number of times the subject is taught per week.
-
-
Method Details
-
equals
Checks if the given object is equal to this WeeklySubjects. Two WeeklySubjects are considered equal if their subjects and amount of them are equal . -
hashCode
public int hashCode()Returns a hash code value for this WeeklySubjects. This method is supported for the benefit of hash tables such as those provided by HashMap. -
getSubject
Returns the subject that is taught.- Returns:
- The subject that is taught.
-
setSubject
Sets the subject that is taught.- Parameters:
subject- The subject to set.
-
getNoPerWeek
public int getNoPerWeek()Returns the number of times the subject is taught per week.- Returns:
- The number of times the subject is taught per week.
-
setNoPerWeek
public void setNoPerWeek(int noPerWeek) Sets the number of times the subject is taught per week.- Parameters:
noPerWeek- The number of times to set.
-
toString
Returns a string representation of this WeeklySubjects. The string representation is the subject and the number of times it is taught per week.
-