Package org.libreplan.business.workingday

Examples of org.libreplan.business.workingday.IntraDayDate


        return hoursInGap;
    }

    private Integer calculateHoursInGap(Resource resource, LocalDate startDate,
            int startHour, LocalDate endDate, int endHour) {
        IntraDayDate intraStart = IntraDayDate.create(startDate,
                hours(startHour));
        IntraDayDate intraEnd = IntraDayDate.create(endDate, hours(endHour));
        return calculateHoursInGap(resource, intraStart, intraEnd);
    }
View Full Code Here


        }
        return type == Type.ALL || isAfterDate(each);
    }

    private boolean isAfterDate(Task each) {
        IntraDayDate start = TaskElementAdapter.toIntraDay(each.getBeginDate());
        IntraDayDate end = TaskElementAdapter.toIntraDay(each.getEndDate());
        return start.compareTo(date) > 0 || end.compareTo(date) > 0;
    }
View Full Code Here

                return taskElement.getNotes();
            }

            @Override
            public GanttDate getBeginDate() {
                IntraDayDate start = taskElement.getIntraDayStartDate();
                return toGantt(start);
            }
View Full Code Here

                    BigDecimal proportion) {
                if (proportion.compareTo(BigDecimal.ZERO) == 0) {
                    return getBeginDate();
                }

                IntraDayDate start = taskElement.getIntraDayStartDate();
                IntraDayDate end = taskElement.getIntraDayEndDate();

                EffortDuration effortBetween = start.effortUntil(end);
                int seconds = new BigDecimal(effortBetween.getSeconds())
                        .multiply(proportion).toBigInteger().intValue();
                return TaskElementAdapter.toGantt(
View Full Code Here

    }

    protected void resetAssigmentsForInterval(
            AllocationIntervalInsideTask interval,
            List<T> assignmentsCreated) {
        IntraDayDate originalStart = getIntraDayStartDate();
        IntraDayDate originalEnd = getIntraDayEndDate();

        updateAssignments(interval, assignmentsCreated);

        // The resource allocation cannot grow beyond the start of the task.
        // This
View Full Code Here

    private void resetAssigmentsFittingAllocationDatesToResultingAssignments(
            AllocationInterval interval, List<T> assignmentsCreated) {
        updateAssignments(interval, assignmentsCreated);

        LocalDate startConsideringAssignments = getStartConsideringAssignments();
        IntraDayDate start = IntraDayDate
                .startOfDay(startConsideringAssignments);
        if (interval.getStartInclusive()
                .areSameDay(startConsideringAssignments)) {
            start = interval.getStartInclusive();
        }
        getDayAssignmentsState().setIntraDayStart(start);

        LocalDate endConsideringAssignments = getEndDateGiven(getAssignments());
        IntraDayDate end = IntraDayDate.startOfDay(endConsideringAssignments);
        if (interval.getEndExclusive().areSameDay(endConsideringAssignments)) {
            end = interval.getEndExclusive();
        }
        getDayAssignmentsState().setIntraDayEnd(end);
    }
View Full Code Here

        }
        return ResourcesPerDay.calculateFrom(sumTotalEffort, sumWorkableEffort);
    }

    private IntraDayDate startFor(LocalDate dayDate) {
        IntraDayDate start = getIntraDayStartDate();
        if (start.getDate().equals(dayDate)) {
            return start;
        } else {
            return IntraDayDate.startOfDay(dayDate);
        }
    }
View Full Code Here

            return IntraDayDate.startOfDay(dayDate);
        }
    }

    private IntraDayDate endFor(LocalDate assignmentDate) {
        IntraDayDate end = getIntraDayEndDate();
        if (end.getDate().equals(assignmentDate)) {
            return end;
        } else {
            return IntraDayDate.startOfDay(assignmentDate).nextDayAtStart();
        }
    }
View Full Code Here

        }
        return assignments.get(0).getDay();
    }

    public LocalDate getStartDate() {
        IntraDayDate start = getIntraDayStartDate();
        return start != null ? start.getDate() : null;
    }
View Full Code Here

                EffortDuration toDistribute = getResourceAllocation()
                        .calculateTotalToDistribute(day, getGoal());
                EffortDuration effortLimited = min(limit, toDistribute);
                PartialDay distributeOn = day;
                if (effortLimited.equals(limit)) {
                    IntraDayDate start = day.getStart();
                    distributeOn = new PartialDay(start, start.increaseBy(
                            resourcesPerDay, effortLimited));
                }
                return effortDistributor.distributeForDay(distributeOn,
                        effortLimited);
            }
View Full Code Here

TOP

Related Classes of org.libreplan.business.workingday.IntraDayDate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.