Package be.gaudry.model.edu.course
Class Course
java.lang.Object
be.gaudry.model.edu.course.Course
- All Implemented Interfaces:
ILightObject
Concrete course (subject, teacher, parent course, location, goals, etc)
- Since:
- 1.0 Oct 12, 2008, 1.0
- Version:
- %I%, %G%
- Author:
- Steph GAUDRY
-
Field Summary
Fields inherited from interface be.gaudry.model.ILightObject
DEFAULT_ID -
Constructor Summary
ConstructorsConstructorDescriptionCourse()Course(int id, CourseSubject subject)Course(int id, CourseSubject subject, Collection<Examination> examinations)Course(CourseSubject subject) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Examination examination)booleanIndicates whether some other object is "equal to" this course.String representation of the object.intgetId()Identifier of the ILightObjectinthashCode()Returns a hash code value for the course.voidremove(Examination examination)voidsetDisplay(String display)Sets the display.voidsetId(int id)voidsetParentCourse(Course parentCourse)voidsetSubject(CourseSubject subject)toString()
-
Constructor Details
-
Course
public Course() -
Course
- Parameters:
subject-
-
Course
- Parameters:
id-subject-
-
Course
- Parameters:
id-subject-
-
-
Method Details
-
add
-
remove
-
getSubject
- Returns:
- the subject
-
setSubject
- Parameters:
subject- the subject to set
-
getExaminations
- Returns:
- the examinations
-
getParentCourse
- Returns:
- the parentCourse
-
setParentCourse
- Parameters:
parentCourse- the parentCourse to set
-
getDisplay
Description copied from interface:ILightObjectString representation of the object. This should be a concise but meaningful representation that is easy for a person to read. \nInto theILightObjectimplementations, thetoString()method is often used to return the values of the properties to debug.- Specified by:
getDisplayin interfaceILightObject- Returns:
- the display
-
setDisplay
Description copied from interface:ILightObjectSets the display. \nThis general contract does not guarantee that theILightObject.getDisplay()method will return the same string as the display argument. \nIn many subclasses of the basic implementationAbstractLightObject, theILightObject.getDisplay()method returns a String built from a few meaningful properties. Thus, setting the display must be implemented in a way to respect the inheritance principle; the subclass behavior must be the same as expected from the supertype. \nBe careful than overriding this may produces side effects because setting the display may affects other properties. \nA good way is overriding the GenericLightObjectTest<T> class to test this. \n\nMaven dependency for the the GenericLightObjectTest<T>:- groupId: be.gaudry.broldev
- artifactId: broldev.core.jpa-tests
- Specified by:
setDisplayin interfaceILightObject- Parameters:
display- String representation of the object- See Also:
ILightObject.getDisplay()
-
getId
public int getId()Description copied from interface:ILightObjectIdentifier of the ILightObject- Specified by:
getIdin interfaceILightObject- Returns:
- the id
-
setId
public void setId(int id)- Specified by:
setIdin interfaceILightObject- Parameters:
id- the id to set- See Also:
ILightObject.getId()
-
equals
Indicates whether some other object is "equal to" this course. Some fields are not checked here :Parent course- List of
examinations(examinations)
- Overrides:
equalsin classObject- Parameters:
obj- the reference object with which to compare.- Returns:
trueif this course is the same as the obj argument;falseotherwise.- See Also:
Object.equals(java.lang.Object),hashCode()
-
hashCode
public int hashCode()Returns a hash code value for the course. Some fields are not considered here :Parent course- List of
examinations(examinations)
- Overrides:
hashCodein classObject- Returns:
- a hash code value for this course.
- See Also:
Object.hashCode(),equals(Object)
-
toString
- Overrides:
toStringin classObject- See Also:
AbstractLightObject.toString()
-