package net.sourceforge.fenixedu.domain.student.curriculum; import java.io.Serializable; import java.math.BigDecimal; import net.sourceforge.fenixedu.domain.CurricularCourse; import net.sourceforge.fenixedu.domain.ExecutionSemester; import net.sourceforge.fenixedu.domain.ExecutionYear; import net.sourceforge.fenixedu.domain.Grade; import org.apache.commons.lang.StringUtils; import com.linkare.commons.metainfo.Linkare; import pt.utl.ist.fenix.tools.util.i18n.MultiLanguageString; abstract public class CurriculumEntry implements Serializable, ICurriculumEntry { public boolean isNotInDegreeCurriculumEnrolmentEntry() { return false; } @Linkare(author = "Paulo Zenida", comments = "Changed the modifiers order according to the JLS suggestions") public final boolean getIsNotInDegreeCurriculumEnrolmentEntry() { return isNotInDegreeCurriculumEnrolmentEntry(); } protected double ectsCredits(final CurricularCourse curricularCourse) { final double ectsCredits = curricularCourse.getEctsCredits().doubleValue(); return ectsCredits == 0 ? 6.0 : ectsCredits; } public BigDecimal getWeigthTimesGrade() { final String grade = getGradeValue(); return StringUtils.isNumeric(grade) ? getWeigthForCurriculum().multiply(BigDecimal.valueOf(Double.valueOf(grade))) : null; } abstract public Grade getGrade(); public String getGradeValue() { return getGrade() == null ? null : getGrade().getValue(); } public ExecutionSemester getExecutionPeriod() { return null; } @Linkare(author = "Paulo Zenida", comments = "Changed the modifiers order according to the JLS suggestions") public final boolean hasExecutionPeriod() { return getExecutionPeriod() != null; } @Linkare(author = "Paulo Zenida", comments = "Changed the modifiers order according to the JLS suggestions") public final ExecutionYear getExecutionYear() { return getExecutionPeriod() == null ? null : getExecutionPeriod().getExecutionYear(); } @Linkare(author = "Paulo Zenida", comments = "Changed the modifiers order according to the JLS suggestions") public final String getCode() { return null; } @Linkare(author = "Paulo Zenida", comments = "Changed the modifiers order according to the JLS suggestions") public final MultiLanguageString getName() { return new MultiLanguageString(); } }