Interface IWorkingCalendar


public interface IWorkingCalendar
A working calendar is used to define standard working and nonworking times. A project must have one base (default) calendar. Users may have their own calendars, which are based on a base calendar.
Author:
POLARION SOFTWARE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Create document element of this working calendar
    Returns the the base calendar on which this calendar depends.
    The unique ID for the base calendar on which this calendar depends; only used if this calendar is not a base calendar.
    Returns unique identifier of this calendar.
    Name of user's calendar is the id of the user, otherwise the name may be arbitrary.
    getWorkingDay(long time, boolean considerBase)
    Returns working day for particular date (specific definitions are taken into account).
    getWorkingDays(boolean considerBase)
    Returns all working days defined in this calendar; working days from base calendar may be included as well (working days from this calendar are in the beginning of the list).
    getWorkingWeekDay(int day, boolean considerBase)
    Returns working day for a typical (with no specific definition) week day.
    boolean
    Indicates whether the calendar is a base calendar.
    int
    numberOfWorkingDays(Date startDate, Date endDate)
    Returns number of working days from the 'startDate' to the 'endDate' inclusive.
    void
    setBaseCalendar(boolean isBaseCalendar)
    Sets whether the calendar is a base calendar
    void
    Sets the unique ID for the base calendar on which this calendar depends; only used if this calendar is not a base calendar.
    void
    Sets unique identifier of this calendar
    void
    Sets name of user's calendar.
    void
    Sets working days defined for this calendar.
  • Field Details

  • Method Details

    • getID

      @Nullable String getID()
      Returns unique identifier of this calendar.
      Returns:
      the unique ID of this calendar
    • setID

      void setID(@Nullable String id)
      Sets unique identifier of this calendar
      Parameters:
      id - the id to set
    • getName

      @Nullable String getName()
      Name of user's calendar is the id of the user, otherwise the name may be arbitrary.
    • setName

      void setName(@Nullable String name)
      Sets name of user's calendar.
    • isBaseCalendar

      boolean isBaseCalendar()
      Indicates whether the calendar is a base calendar.
    • setBaseCalendar

      void setBaseCalendar(boolean isBaseCalendar)
      Sets whether the calendar is a base calendar
      Parameters:
      isBaseCalendar -
    • getBaseCalendarID

      @Nullable String getBaseCalendarID()
      The unique ID for the base calendar on which this calendar depends; only used if this calendar is not a base calendar.
    • setBaseCalendarID

      void setBaseCalendarID(@Nullable String id)
      Sets the unique ID for the base calendar on which this calendar depends; only used if this calendar is not a base calendar.
      Parameters:
      id - the id to set
    • getBaseCalendar

      @Nullable IWorkingCalendar getBaseCalendar()
      Returns the the base calendar on which this calendar depends.
      See Also:
    • getWorkingWeekDay

      @Nullable IWorkingDay getWorkingWeekDay(int day, boolean considerBase)
      Returns working day for a typical (with no specific definition) week day.
      Parameters:
      day - Calendar day constant
      considerBase - whether base calendar should be considered if no entry is in this calendar
    • getWorkingDay

      @Nullable IWorkingDay getWorkingDay(long time, boolean considerBase)
      Returns working day for particular date (specific definitions are taken into account).
      Parameters:
      time -
      considerBase - whether base calendar should be considered if no entry is in this calendar
      Returns:
      the IWorkingDay for the specified parameters
    • getWorkingDays

      @Nullable IWorkingDay[] getWorkingDays(boolean considerBase)
      Returns all working days defined in this calendar; working days from base calendar may be included as well (working days from this calendar are in the beginning of the list).
      Parameters:
      considerBase - whether working days from base calendar should be included
    • setWorkingDays

      void setWorkingDays(@Nullable IWorkingDay[] days)
      Sets working days defined for this calendar.
      Parameters:
      days - the working days to set
    • numberOfWorkingDays

      int numberOfWorkingDays(@NotNull Date startDate, @NotNull Date endDate)
      Returns number of working days from the 'startDate' to the 'endDate' inclusive.
      Since:
      3.8.0
    • createElement

      @NotNull Element createElement(@NotNull Element parent)
      Create document element of this working calendar
      Parameters:
      parent - the parent element
      Returns:
      document element of this working calendar