/** Executes/Redoes the changes of the allocation edit */ public void execute() { allocation.startDate = startDate; allocation.endDate = endDate; Collections.sort(allocation.getProject().getTeamAllocations()); }
/** Undoes the changes of the person edit */ public void undo() { allocation.startDate = oldStartDate; allocation.endDate = oldEndDate; Collections.sort(allocation.getProject().getTeamAllocations()); }
/** * Compares this allocation to another based on the start dates of the allocations * * @return the comparison of the start dates of the two allocations */ @Override public int compareTo(Allocation allocation) { LocalDate allocationStartDate = this.getStartDate(); LocalDate allocation2StarDate = allocation.getStartDate(); return allocationStartDate.compareTo(allocation2StarDate); }