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
display
Fields inherited from interface be.gaudry.model.ILightObject
DEFAULT_ID
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Examination with all default values : id : -1 date : now course : newCourse
maximum : 10Examination(int id)
Creates a new Examination with all default values : date : now course : newCourse
maximum : 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 TypeMethodDescriptionvoid
addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
Add a property change listener for a specific property.void
addQuotation(Student student, Quotation quotation)
boolean
Indicates whether some other object is "equal to" this LightObject.Iterate allQuotation
to retrieve value and compute average if not corresponding toempty quotation
orstudent absent
for this examinationgetDate()
int
getQuotation(Student student)
int
hashCode()
Returns a hash code value for this LightObject.void
removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
Remove a property change listener for a specific property.void
removeQuotation(Student student)
Removes theQuotation
for a Student key from the quotations map if it is present (optional operation).void
setComment(String comment)
void
Don't use this method to add an examination for a course.void
void
setMaximum(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
- ThePropertyChangeListener
to be added.
-
removePropertyChangeListener
Remove a property change listener for a specific property.- Parameters:
propertyName
- The name of the property that was listened on.listener
- ThePropertyChangeListener
to be removed
-
getAverage
Iterate allQuotation
to retrieve value and compute average if not corresponding toempty quotation
orstudent absent
for this examination- Returns:
-
addQuotation
Associates the specifiedQuotation
with the specifiedStudent
key 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.put
implementation.- Parameters:
student
- key to store the quotationquotation
- quotation to store
-
removeQuotation
Removes theQuotation
for a Student key from the quotations map if it is present (optional operation).
UsesMap.remove
implementation.- 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:AbstractLightObject
Indicates whether some other object is "equal to" this LightObject.
Check is done on following fields :id
getDisplay
method (Use getDisplay instead of display because getDisplay may be override in child class, and display field may be null).
- Overrides:
equals
in classAbstractLightObject
- Parameters:
o
- the reference object with which to compare.- Returns:
true
if this LightObject is the same as the obj argument;false
otherwise.- See Also:
AbstractLightObject.hashCode()
-
hashCode
public int hashCode()Description copied from class:AbstractLightObject
Returns 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:
hashCode
in 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:
toString
in classAbstractLightObject
- Returns:
- a String representation of this Examination
- See Also:
Object.toString()
-