Package org.fenixedu.academic.util

Examples of org.fenixedu.academic.util.HourMinuteSecond$Property


        return null;
    }

    public SortedSet<YearMonthDay> getAllPossibleDatesToInsertSummary() {

        HourMinuteSecond now = new HourMinuteSecond();
        YearMonthDay currentDate = new YearMonthDay();
        SortedSet<YearMonthDay> datesToInsert = getAllLessonDatesUntil(currentDate);

        for (Summary summary : getAssociatedSummaries()) {
            YearMonthDay summaryDate = summary.getSummaryDateYearMonthDay();
View Full Code Here


        });
        if (!wasFinished()) {
            YearMonthDay startDateToSearch = getLessonStartDay();
            YearMonthDay endDateToSearch = getLessonEndDay();
            final HourMinuteSecond b = getBeginHourMinuteSecond();
            final HourMinuteSecond e = getEndHourMinuteSecond();
            for (final YearMonthDay yearMonthDay : getAllValidLessonDatesWithoutInstancesDates(startDateToSearch, endDateToSearch)) {
                final DateTime start =
                        new DateTime(yearMonthDay.getYear(), yearMonthDay.getMonthOfYear(), yearMonthDay.getDayOfMonth(),
                                b.getHour(), b.getMinuteOfHour(), b.getSecondOfMinute(), 0);
                final DateTime end =
                        new DateTime(yearMonthDay.getYear(), yearMonthDay.getMonthOfYear(), yearMonthDay.getDayOfMonth(),
                                e.getHour(), e.getMinuteOfHour(), e.getSecondOfMinute(), 0);
                dates.add(new Interval(start, end));
            }
        }
        return dates;
    }
View Full Code Here

        }
        final DateTime intervalEnd = interval.getEnd();
        if (intervalEnd.isBefore(startDateToSearch.toDateTimeAtMidnight())) {
            return false;
        }
        final HourMinuteSecond b = getBeginHourMinuteSecond();
        final HourMinuteSecond e = getEndHourMinuteSecond();
        for (final YearMonthDay yearMonthDay : getAllValidLessonDatesWithoutInstancesDates(startDateToSearch, endDateToSearch)) {
            final DateTime start =
                    new DateTime(yearMonthDay.getYear(), yearMonthDay.getMonthOfYear(), yearMonthDay.getDayOfMonth(),
                            b.getHour(), b.getMinuteOfHour(), b.getSecondOfMinute(), 0);
            if (start.isAfter(intervalEnd)) {
                continue;
            }
            final DateTime end =
                    new DateTime(yearMonthDay.getYear(), yearMonthDay.getMonthOfYear(), yearMonthDay.getDayOfMonth(),
                            e.getHour(), e.getMinuteOfHour(), e.getSecondOfMinute(), 0);
            if (end.isBefore(intervalStart)) {
                continue;
            }
            return true;
        }
View Full Code Here

    private boolean isAllIntervalIn(Interval interval, SortedSet<YearMonthDay> allLessonDates) {

        YearMonthDay intervalStartDate = interval.getStart().toYearMonthDay();
        YearMonthDay intervalEndDate = interval.getEnd().toYearMonthDay();

        HourMinuteSecond intervalBegin =
                new HourMinuteSecond(interval.getStart().getHourOfDay(), interval.getStart().getMinuteOfHour(), 0);
        HourMinuteSecond intervalEnd =
                new HourMinuteSecond(interval.getEnd().getHourOfDay(), interval.getEnd().getMinuteOfHour(), 0);

        for (YearMonthDay day : allLessonDates) {
            if (intervalStartDate.isEqual(intervalEndDate)) {
                if (day.isEqual(intervalStartDate) && !intervalBegin.isBefore(getBeginHourMinuteSecond())
                        && !intervalEnd.isAfter(getEndHourMinuteSecond())) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

    private boolean contains(Interval interval, SortedSet<YearMonthDay> allLessonDates) {

        YearMonthDay intervalStartDate = interval.getStart().toYearMonthDay();
        YearMonthDay intervalEndDate = interval.getEnd().toYearMonthDay();

        HourMinuteSecond intervalBegin =
                new HourMinuteSecond(interval.getStart().getHourOfDay(), interval.getStart().getMinuteOfHour(), interval
                        .getStart().getSecondOfMinute());
        HourMinuteSecond intervalEnd =
                new HourMinuteSecond(interval.getEnd().getHourOfDay(), interval.getEnd().getMinuteOfHour(), interval.getEnd()
                        .getSecondOfMinute());

        for (YearMonthDay day : allLessonDates) {
            if (intervalStartDate.isEqual(intervalEndDate)) {
                if (day.isEqual(intervalStartDate) && !intervalBegin.isAfter(getEndHourMinuteSecond())
                        && !intervalEnd.isBefore(getBeginHourMinuteSecond())) {
                    return true;
                }
            } else {
                if ((day.isAfter(intervalStartDate) && day.isBefore(intervalEndDate)) || day.isEqual(intervalStartDate)
                        && !getEndHourMinuteSecond().isBefore(intervalBegin)
View Full Code Here

        if (isExtraLesson()) {
            return false;
        }

        Lesson lesson = getLesson();
        if (lesson.isDateValidToInsertSummary(getDate()) && lesson.isTimeValidToInsertSummary(new HourMinuteSecond(), getDate())
                && !getWrittenSummary()) {
            return true;
        }

        return false;
View Full Code Here

        setTaught(taught);

        if (isExtraLesson) {
            super.setLessonInstance(null);
            setRoom(room);
            HourMinuteSecond hourMinuteSecond =
                    new HourMinuteSecond(hour.get(DateTimeFieldType.hourOfDay()), hour.get(DateTimeFieldType.minuteOfHour()), 0);
            setSummaryHourHourMinuteSecond(hourMinuteSecond);
        } else {
            setRoom(lesson.getSala());
            setSummaryHourHourMinuteSecond(lesson.getBeginHourMinuteSecond());
            lessonInstanceManagement(lesson, day, lesson.getSala());
View Full Code Here

                throw new DomainException("error.summary.already.exists");
            }
            if (!lesson.isDateValidToInsertSummary(date)) {
                throw new DomainException("error.summary.no.valid.date.to.lesson");
            }
            if (!lesson.isTimeValidToInsertSummary(new HourMinuteSecond(), date)) {
                throw new DomainException("error.summary.no.valid.time.to.lesson");
            }
        } else if (!executionSemester.containsDay(date)) {
            throw new DomainException("error.summary.no.valid.date");
        }
View Full Code Here

    public boolean isExtraSummary() {
        return getIsExtraLesson().booleanValue();
    }

    public DateTime getSummaryDateTime() {
        HourMinuteSecond time = getSummaryHourHourMinuteSecond();
        return getSummaryDateYearMonthDay().toDateTime(
                new TimeOfDay(time.getHour(), time.getMinuteOfHour(), time.getSecondOfMinute(), 0));
    }
View Full Code Here

            throw new DomainException("error.lessonInstance.already.exist");
        }

        Space room = lesson.getSala();

        HourMinuteSecond beginTime = lesson.getBeginHourMinuteSecond();
        HourMinuteSecond endTime = lesson.getEndHourMinuteSecond();
        DateTime beginDateTime =
                new DateTime(day.getYear(), day.getMonthOfYear(), day.getDayOfMonth(), beginTime.getHour(),
                        beginTime.getMinuteOfHour(), beginTime.getSecondOfMinute(), 0);
        DateTime endDateTime =
                new DateTime(day.getYear(), day.getMonthOfYear(), day.getDayOfMonth(), endTime.getHour(),
                        endTime.getMinuteOfHour(), endTime.getSecondOfMinute(), 0);

        setRootDomainObject(Bennu.getInstance());
        setBeginDateTime(beginDateTime);
        setEndDateTime(endDateTime);
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.util.HourMinuteSecond$Property

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.