IEnrolment enrolment = (IEnrolment) iterator.next();
IEnrollment enrolment = (IEnrollment) iterator.next();
	public Double calculateStudentWeightedAverage(IStudentCurricularPlan studentCurricularPlan)		throws ExcepcaoPersistencia	{		float marks = 0;		int numberOfWeigths = 0;		List enrolments =			SuportePersistenteOJB				.getInstance()				.getIPersistentEnrolment()				.readAllByStudentCurricularPlan(				studentCurricularPlan);		Iterator iterator = enrolments.iterator();		while (iterator.hasNext())		{			IEnrolment enrolment = (IEnrolment) iterator.next();			if ((enrolment.getEnrolmentState().equals(EnrolmentState.APROVED))				&& (!enrolment					.getCurricularCourse()					.getType()					.equals(CurricularCourseType.P_TYPE_COURSE_OBJ)))			{				if (!(enrolment instanceof IEnrolmentInExtraCurricularCourse))				{					List newEnrolmentList = newEnrolmentList(enrolment);					Iterator evaluations = newEnrolmentList.iterator();					int enrolmentMark = 0;					float enrolmentWeight = 0;					while (evaluations.hasNext())					{						IEnrolmentEvaluation enrolmentEvaluation =							(IEnrolmentEvaluation) evaluations.next();						try						{							if (new Integer(enrolmentEvaluation.getGrade()).intValue() > enrolmentMark)							{								enrolmentMark = new Integer(enrolmentEvaluation.getGrade()).intValue();								enrolmentWeight =									enrolment.getCurricularCourse().getCredits().floatValue();							}						}						catch (NumberFormatException e)						{							// This mark will not count for the average						}					}					if (enrolmentMark > 0)					{						marks += (enrolmentMark * enrolmentWeight);						numberOfWeigths += enrolmentWeight;					}				}			}		}		if (marks == 0)		{			return new Double(0);		}		return NumberUtils.formatNumber(new Double(marks / numberOfWeigths), 1);	}