Package org.libreplan.business.calendars.entities.AvailabilityTimeLine

Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.FixedPoint


        AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
        timeLine.invalidFrom(contemporaryExample);
        List<Interval> validPeriods = timeLine.getValidPeriods();

        assertThat(validPeriods, definedBy(StartOfTime.create(),
                new FixedPoint(contemporaryExample)));
    }
View Full Code Here


                point(contemporaryExample), point(contemporaryExample
                        .plusDays(1)), EndOfTime.create()));
    }

    private static FixedPoint point(LocalDate param) {
        return new FixedPoint(param);
    }
View Full Code Here

    private static CapacityResult thereIsCapacityOn(ICalendar calendar,
            EffortDuration effortToAllocate,
            ResourcesPerDay resourcesPerDay, List<Interval> validPeriods) {
        EffortDuration sum = zero();
        for (Interval each : validPeriods) {
            FixedPoint start = (FixedPoint) each.getStart();
            FixedPoint end = (FixedPoint) each.getEnd();
            EffortDuration pending = effortToAllocate.minus(sum);
            sum = sum.plus(sumDurationUntil(calendar, pending,
                    resourcesPerDay, start.getDate(), end.getDate()));
            if (sum.compareTo(effortToAllocate) >= 0) {
                return new CapacityAvailable();
            }
        }
        return new ValidPeriodsDontHaveCapacity(validPeriods, sum,
View Full Code Here

                        endExclusive.asExclusiveEnd()),
                new IEffortFrom<Interval>() {

                    @Override
                    public EffortDuration from(Interval each) {
                        FixedPoint intervalStart = (FixedPoint) each.getStart();
                        FixedPoint intervalEnd = (FixedPoint) each.getEnd();
                        return getAssignedDuration(
                                IntraDayDate.convert(intervalStart.getDate(), startInclusive),
                                IntraDayDate.convert(intervalEnd.getDate(), endExclusive));
                    }
                });
    }
View Full Code Here

    private static DateAndHour convert(DateAndHour possibleMatch,
            DatePoint datePoint) {
        if (datePoint instanceof StartOfTime || datePoint instanceof EndOfTime) {
            return null;
        }
        FixedPoint p = (FixedPoint) datePoint;
        if (possibleMatch != null
                && possibleMatch.getDate().equals(p.getDate())) {
            return possibleMatch;
        }
        return DateAndHour.from(p.getDate());
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.calendars.entities.AvailabilityTimeLine.FixedPoint

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.