⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appointment.java

📁 Rapla是一个灵活的多用户资源管理系统。它提供的一些功能有:日历GUI
💻 JAVA
字号:
/*--------------------------------------------------------------------------*
 | Copyright (C) 2006 Gereon Fassbender, Christopher Kohlhaas               |
 |                                                                          |
 | This program is free software; you can redistribute it and/or modify     |
 | it under the terms of the GNU General Public License as published by the |
 | Free Software Foundation. A copy of the license has been included with   |
 | these distribution in the COPYING file, if not go to www.fsf.org         |
 |                                                                          |
 | As a special exception, you are granted the permissions to link this     |
 | program with every library, which license fulfills the Open Source       |
 | Definition as published by the Open Source Initiative (OSI).             |
 *--------------------------------------------------------------------------*/
package org.rapla.entities.domain;
import java.util.Date;

import org.rapla.entities.Entity;
import org.rapla.entities.Ownable;
import org.rapla.entities.RaplaObject;
import org.rapla.entities.RaplaType;
/** The basic building blocks of reservations.
    @see Reservation
    @see Repeating*/
public interface Appointment extends RaplaObject,Entity, Comparable,Ownable {
    final RaplaType TYPE = new RaplaType(Appointment.class, "appointment" );
    Date getStart();
    Date getEnd();
    /** <p>
        If no repeating is set this method will return the same
        as <code>getEnd()</code>.
        </p>
        <p>
        If the repeating has no end the method will return <strong>Null</strong>.
        Oterwise the maximum of getEnd() and repeating.getEnd() will be returned.
        </p>
        @see #getEnd
        @see Repeating
    */
    Date getMaxEnd();

    /** returns the reservation that owns the appointment.
    @return the reservation that owns the appointment or null if
    the appointment does not belong to a reservation.
    */
    Reservation getReservation();

    /** @return null if the appointment has no repeating
    */
    Repeating getRepeating();

    /** Enables repeating for this appointment.
        Use getRepeating() to manipulate the repeating. */
    void setRepeatingEnabled(boolean enableRepeating);

    /** returns if the appointment has a repeating */
    boolean isRepeatingEnabled();

    /** Changes the start- and end-time of the appointment.
     */
    void move(Date start,Date end);
    /** Moves the start-time of the appointment.
        The end-time will be adjusted accordingly to the duration of the appointment.
     */
    void move(Date newStart);

    /** Tests two appointments for overlap.
        Important:  Times like 13:00-14:00 and 14:00-15:00 do not overlap
        The overlap-relation must be symmetric <code>a1.overlaps(a2) == a2.overlaps(a1)</code>
        @return true if the appointment overlaps the given appointment.
    */
    boolean overlaps(Appointment appointment);

    /** Test for overlap with a period. 
     *  same as overlaps( start, end, true)
      * @return true if the overlaps with the given period.
    */
    boolean overlaps(Date start,Date end);

    /** Test for overlap with a period. You can specify if exceptions should be considered in the overlapping algorithm.
    @return true if the overlaps with the given period.
    */
    boolean overlaps(Date start,Date end,  boolean considerExceptions);
    
    /** Returns if the exceptions, repeatings, start and end dates of the Appoinemnts are the same.*/
    boolean matches(Appointment appointment);

    /** @param maxDate must not be null, specifies the last date that should be searched

    returns the first date at which the two appointments differ (dates after maxDate will not be calculated)
    */
    Date getFirstDifference( Appointment a2, Date maxDate );

    /** @param maxDate must not be null, specifies the last date that should be searched
       
    returns the last date at which the two appointments differ. (dates after maxDate will not be calculated)*/
    Date getLastDifference( Appointment a2, Date maxDate );

    /** this method will be used for future enhancements */
    boolean isWholeDaysSet();

    /** this method will be used for future enhancements */
    void setWholeDays(boolean enable);

    /** adds all Appointment-blocks in the given period to the appointmentBlockArray.
        A block is in the period if its starttime<end or its endtime>start. Exceptions are excluded, i.e. there is no block on an exception date. 
     */
    void createBlocks(Date start,Date end,AppointmentBlockArray blocks);
    
    /** adds all Appointment-blocks in the given period to the appointmentBlockArray.
    A block is in the period if its starttime<end or its endtime>start. You can specify if exceptions should be excluded.
    */
    void createBlocks(Date start,Date end,AppointmentBlockArray blocks, boolean excludeExceptions);
    
    final Appointment[] EMPTY_ARRAY = new Appointment[0];
}












⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -