Documentation of 'org.jquantlib.time.Calendar' Java class
Calendar
org.jquantlib.time

Class Calendar

    • Field Detail

      • UKNOWN_BUSINESS_DAY_CONVENTION

        public static final java.lang.String UKNOWN_BUSINESS_DAY_CONVENTION
        See Also:
        Constant Field Values
    • Constructor Detail

      • Calendar

        public Calendar()
    • Method Detail

      • empty

        public boolean empty()
        Returns whether or not the calendar is initialized
      • name

        public java.lang.String name()
        Returns the name of the calendar. warning This method is used for output and comparison between calendars. It is not meant to be used for writing switch-on-type code.
        Returns:
        String - name of calendar
      • isBusinessDay

        public boolean isBusinessDay(Date d)
        Returns true if the date is a business day for the given market.
      • isHoliday

        public boolean isHoliday(Date d)
        Returns true if the date is a holiday for the given market.
      • isWeekend

        public boolean isWeekend(Weekday w)
        Returns true iff the weekday is part of the weekend for the given market.
      • isEndOfMonth

        public boolean isEndOfMonth(Date d)
        Returns true if the date is last business day for the month in given market.
      • endOfMonth

        public Date endOfMonth(Date d)
        Returns last business day of the month to which the given date belongs
        Parameters:
        d -
        Returns:
        last business Date based on passed date
      • addHoliday

        public void addHoliday(Date d)
        Adds a date to the set of holidays for the given calendar.

        NOTE: This method does not affect pre-defined calendars, returning silently.

      • removeHoliday

        public void removeHoliday(Date d)
        Removes a date from the set of holidays for the given calendar.

        NOTE: This method does not affect pre-defined calendars, returning silently.

      • holidayList

        public static java.util.List<Date> holidayList(Calendar c,
                                                       Date from,
                                                       Date to,
                                                       boolean includeWeekEnds)
        Returns the holidays between two dates
      • adjust

        public Date adjust(Date date)
        Adjusts a non-business day to the appropriate near business day with respect to the given convention.

        Assumes convention BusinessDayConvention.Following

      • adjust

        public Date adjust(Date d,
                           BusinessDayConvention c)
        Adjusts a non-business day to the appropriate near business day with respect to the given convention.
      • advance

        public Date advance(Date date,
                            Period period,
                            BusinessDayConvention convention)
        Advances the given date as specified by the given period and returns the result.
      • advance

        public Date advance(Date date,
                            Period period,
                            BusinessDayConvention convention,
                            boolean endOfMonth)
        Advances the given date as specified by the given period and returns the result.
      • advance

        public Date advance(Date date,
                            int n,
                            TimeUnit unit)
        Advances the given date of the given number of business days and returns the result.
      • advance

        public Date advance(Date date,
                            Period period)
        Advances the given date as specified by the given period and returns the result.
      • advance

        public Date advance(Date d,
                            int n,
                            TimeUnit unit,
                            BusinessDayConvention c,
                            boolean endOfMonth)
        Advances the given date of the given number of business days and returns the result.
      • businessDaysBetween

        public int businessDaysBetween(Date from,
                                       Date to)
        Calculates the number of business days between two given dates and returns the result.
      • businessDaysBetween

        public int businessDaysBetween(Date from,
                                       Date to,
                                       boolean includeFirst,
                                       boolean includeLast)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.