Package org.fenixedu.academic.util

Examples of org.fenixedu.academic.util.HourMinuteSecond


    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

            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);
        setLesson(lesson);
View Full Code Here

    public YearMonthDay getDay() {
        return getBeginDateTime().toYearMonthDay();
    }

    public HourMinuteSecond getStartTime() {
        return new HourMinuteSecond(getBeginDateTime().getHourOfDay(), getBeginDateTime().getMinuteOfHour(), getBeginDateTime()
                .getSecondOfMinute());
    }
View Full Code Here

        return new HourMinuteSecond(getBeginDateTime().getHourOfDay(), getBeginDateTime().getMinuteOfHour(), getBeginDateTime()
                .getSecondOfMinute());
    }

    public HourMinuteSecond getEndTime() {
        return new HourMinuteSecond(getEndDateTime().getHourOfDay(), getEndDateTime().getMinuteOfHour(), getEndDateTime()
                .getSecondOfMinute());
    }
View Full Code Here

TOP

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

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.