diff --git a/libreplan-business/src/main/java/org/libreplan/business/planner/entities/PositionConstraintType.java b/libreplan-business/src/main/java/org/libreplan/business/planner/entities/PositionConstraintType.java index be3ba846c..4da8798e9 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/planner/entities/PositionConstraintType.java +++ b/libreplan-business/src/main/java/org/libreplan/business/planner/entities/PositionConstraintType.java @@ -30,11 +30,6 @@ import org.libreplan.business.orders.entities.Order.SchedulingMode; public enum PositionConstraintType { AS_SOON_AS_POSSIBLE(false, _("as soon as possible")) { - @Override - public PositionConstraintType newTypeAfterMoved(SchedulingMode mode) { - return START_NOT_EARLIER_THAN; - } - @Override public boolean appliesToTheStart() { return true; @@ -42,14 +37,6 @@ public enum PositionConstraintType { }, START_NOT_EARLIER_THAN(true, _("start not earlier than")) { - @Override - public PositionConstraintType newTypeAfterMoved(SchedulingMode mode) { - if(mode == SchedulingMode.FORWARD) - return START_NOT_EARLIER_THAN; - else - return FINISH_NOT_LATER_THAN; - } - @Override public boolean appliesToTheStart() { return true; @@ -69,11 +56,6 @@ public enum PositionConstraintType { }, AS_LATE_AS_POSSIBLE(false, _("as late as possible")) { - @Override - public PositionConstraintType newTypeAfterMoved(SchedulingMode mode) { - return FINISH_NOT_LATER_THAN; - } - @Override public boolean appliesToTheStart() { return false; @@ -81,14 +63,6 @@ public enum PositionConstraintType { }, FINISH_NOT_LATER_THAN(true, _("finish not later than")) { - @Override - public PositionConstraintType newTypeAfterMoved(SchedulingMode mode) { - if(mode == SchedulingMode.FORWARD) - return START_NOT_EARLIER_THAN; - else - return FINISH_NOT_LATER_THAN; - } - @Override public boolean appliesToTheStart() { return false; @@ -110,7 +84,12 @@ public enum PositionConstraintType { this.name = name; } - public abstract PositionConstraintType newTypeAfterMoved(SchedulingMode mode); + public PositionConstraintType newTypeAfterMoved(SchedulingMode mode) { + if(mode == SchedulingMode.FORWARD) + return START_NOT_EARLIER_THAN; + else + return FINISH_NOT_LATER_THAN; + } public boolean isAssociatedDateRequired() { return dateRequired;