Package be.gaudry.model.edu.score
Class Examination
java.lang.Object
be.gaudry.model.AbstractLightObject
be.gaudry.model.LightObject
be.gaudry.model.edu.score.Examination
- All Implemented Interfaces:
ILightObject,Serializable
- Since:
- 1.0 Dec 28, 2008
- Author:
- Steph GAUDRY
- See Also:
- Serialized Form
-
Field Summary
FieldsFields inherited from class be.gaudry.model.LightObject
displayFields inherited from interface be.gaudry.model.ILightObject
DEFAULT_ID -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Examination with all default values : id : -1 date : now course : newCoursemaximum : 10Examination(int id)Creates a new Examination with all default values : date : now course : newCoursemaximum : 10Examination(int id, Course value)Creates a new Examination with some default values : date : now maximum : 10Examination(int id, Course course, int maximum)Creates a new Quotation with default Date (now)Examination(int id, Date date, Course course, int maximum)Creates a new Examination with some default values : comment : empty stringExamination(int id, Date date, Course course, int maximum, String comment)Examination(Course course)Creates a new Examination with some default values : id : -1 date : now maximum : 10Examination(Course course, int maximum)Creates a new Examination with default Date (now) and id (-1)Examination(Date date, Course course)Creates a new Examination with some default values : id : -1 maximum : 10Examination(Date date, Course course, int maximum)Creates a new Examination with default id (-1) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener)Add a property change listener for a specific property.voidaddQuotation(Student student, Quotation quotation)booleanIndicates whether some other object is "equal to" this LightObject.Iterate allQuotationto retrieve value and compute average if not corresponding toempty quotationorstudent absentfor this examinationgetDate()intgetQuotation(Student student)inthashCode()Returns a hash code value for this LightObject.voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener)Remove a property change listener for a specific property.voidremoveQuotation(Student student)Removes theQuotationfor a Student key from the quotations map if it is present (optional operation).voidsetComment(String comment)voidDon't use this method to add an examination for a course.voidvoidsetMaximum(int maximum)toString()Returns a string representation of the Examination.
Format : "date : course (max)"Methods inherited from class be.gaudry.model.LightObject
getDisplay, getId, setDisplay, setId
-
Field Details
-
propertyChangeSupport
-
-
Constructor Details
-
Examination
public Examination()Creates a new Examination with all default values :- id : -1
- date : now
- course : new
Course - maximum : 10
-
Examination
public Examination(int id)Creates a new Examination with all default values :- date : now
- course : new
Course - maximum : 10
- Parameters:
id-
-
Examination
Creates a new Examination with some default values :- id : -1
- date : now
- maximum : 10
- Parameters:
course- course to set
-
Examination
Creates a new Examination with some default values :- date : now
- maximum : 10
- Parameters:
id-value- course to set
-
Examination
Creates a new Examination with default Date (now) and id (-1)- Parameters:
course- course to setmaximum- maximum of the value
-
Examination
Creates a new Quotation with default Date (now)- Parameters:
id-course- course to setmaximum- maximum of the value
-
Examination
Creates a new Examination with default id (-1)- Parameters:
date- date of the quotationcourse- course to setmaximum- maximum of the value
-
Examination
Creates a new Examination with some default values :- id : -1
- maximum : 10
- Parameters:
date- date of the quotationcourse- course to set
-
Examination
Creates a new Examination with some default values :- comment : empty string
- Parameters:
id-date- date of the quotationcourse- course to setmaximum- maximum of the value
-
Examination
- Parameters:
id-date- date of the quotationcourse- course to setmaximum- maximum of the valuecomment-
-
-
Method Details
-
addPropertyChangeListener
Add a property change listener for a specific property.- Parameters:
propertyName- The name of the property to listen on.listener- ThePropertyChangeListenerto be added.
-
removePropertyChangeListener
Remove a property change listener for a specific property.- Parameters:
propertyName- The name of the property that was listened on.listener- ThePropertyChangeListenerto be removed
-
getAverage
Iterate allQuotationto retrieve value and compute average if not corresponding toempty quotationorstudent absentfor this examination- Returns:
-
addQuotation
Associates the specifiedQuotationwith the specifiedStudentkey in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value.
UsesMap.putimplementation.- Parameters:
student- key to store the quotationquotation- quotation to store
-
removeQuotation
Removes theQuotationfor a Student key from the quotations map if it is present (optional operation).
UsesMap.removeimplementation.- Parameters:
student-
-
getQuotation
-
getDate
- Returns:
- the date
-
setDate
- Parameters:
date- the date to set
-
getMaximum
public int getMaximum()- Returns:
- the maximum
-
setMaximum
public void setMaximum(int maximum)- Parameters:
maximum- the maximum to set
-
getComment
- Returns:
- the comment
-
setComment
- Parameters:
comment- the comment to set
-
getCourse
- Returns:
- the course
-
setCourse
Don't use this method to add an examination for a course. This method does not make reverse link.
UseCourse.add(Examination)instead of this to make bidirectional link.- Parameters:
course- the course to set
-
getQuotations
- Returns:
- the quotations
-
equals
Description copied from class:AbstractLightObjectIndicates whether some other object is "equal to" this LightObject.
Check is done on following fields :idgetDisplaymethod (Use getDisplay instead of display because getDisplay may be override in child class, and display field may be null).
- Overrides:
equalsin classAbstractLightObject- Parameters:
o- the reference object with which to compare.- Returns:
trueif this LightObject is the same as the obj argument;falseotherwise.- See Also:
AbstractLightObject.hashCode()
-
hashCode
public int hashCode()Description copied from class:AbstractLightObjectReturns a hash code value for this LightObject.
Hash is done on following fields :- id
ILightObject.getDisplay()method if not null (Use getDisplay instead of display because getDisplay may be override in child class, and display field may be null).
- Overrides:
hashCodein classAbstractLightObject- Returns:
- a hash code value for this LightObject.
- See Also:
AbstractLightObject.equals(Object)
-
toString
Returns a string representation of the Examination.
Format : "date : course (max)"- Overrides:
toStringin classAbstractLightObject- Returns:
- a String representation of this Examination
- See Also:
Object.toString()
-