package avis.models;

import exception.BadEntry;



public class ReviewGrade {

	/**
	 * @uml.property  name="grade"
	 */
	private float grade;

	public float getGrade() {
		return this.grade;
	}
	
	/**
	 * @uml.property  name="member"
	 * @uml.associationEnd  multiplicity="(1 1)" inverse="reviewGrade:avis.models.Member"
	 */
	private Member member;
	
	public Member getMember() {
		return this.member;
	}

	/**
	 * @uml.property  name="review"
	 * @uml.associationEnd  multiplicity="(1 1)" inverse="reviewGrade:avis.models.Review"
	 */
	private Review review;
	
	public Review getReview() {
		return this.review;
	}

	public ReviewGrade(Review review, Member member, float grade) throws BadEntry {
		// TODO Auto-generated constructor stub
		// TODO VERIFICATIONS
		this.review = review;
		this.member = member;
		update(grade);
	}
	
	public void update(float grade) throws BadEntry {
		// TODO VERIFICATIONS
        //boolean isValid = ratingIsValid(rating) && commentIsValid(comment);

        //if (!isValid) {
        //    throw new BadEntry("Comment and/or rating does not meet the requirements.");
        //}

        this.grade = grade;
    }
	
}

@@ -189,17 +189,16 @@
 ade;%0A%09%7D%0A
-%09
 %0A%09/**%0A%09 
@@ -344,17 +344,16 @@
 member;%0A
-%09
 %0A%09public
@@ -554,17 +554,16 @@
 review;%0A
-%09
 %0A%09public
@@ -695,74 +695,8 @@
 y %7B%0A
-%09%09// TODO Auto-generated constructor stub%0A%09%09// TODO VERIFICATIONS%0A
 %09%09th
@@ -759,17 +759,16 @@
 de);%0A%09%7D%0A
-%09
 %0A%09public
@@ -815,40 +815,16 @@
 y %7B%0A
-%09%09// TODO VERIFICATIONS%0A
         
 //bo
@@ -819,18 +819,16 @@
         
-//
 boolean 
@@ -841,22 +841,21 @@
 d = 
+g
 ra
-ting
+de
 IsValid(
 rati
@@ -854,41 +854,13 @@
 lid(
+g
 ra
-ting) && commentIsValid(comment
+de
 );%0A%0A
@@ -867,18 +867,16 @@
         
-//
 if (!isV
@@ -891,18 +891,16 @@
         
-//
     thro
@@ -919,29 +919,13 @@
 ry(%22
-Comment and/or rating
+Grade
  doe
@@ -968,10 +968,8 @@
     
-//
 %7D%0A%0A 
@@ -1001,12 +1001,110 @@
 ;%0A    %7D%0A
-%09
+%0A%09private boolean gradeIsValid(float grade) %7B%0A        return ((grade %3E= 1) && (grade %3C= 3));%0A    %7D%0A
 %0A%7D%0A

Add grade validity check