Class Calendars

java.lang.Object
io.deephaven.time.calendar.Calendars

public class Calendars extends Object
A collection of business calendars.
  • Method Details

    • calendarsFromConfiguration

      public static List<BusinessCalendar> calendarsFromConfiguration()
      Loads the line-separated calendar XML resources from the resource file configuration value "Calendar.importPath". If the resource file configuration value "Calendar.userImportPath" exists, those line-separated calendar XML resources will be returned as well.
      Returns:
      the calendars
      See Also:
    • removeCalendar

      public static void removeCalendar(String name)
      Removes a calendar from the collection.
      Parameters:
      name - calendar name
      Throws:
      RequirementFailure - if the input is null
    • addCalendar

      public static void addCalendar(BusinessCalendar cal)
      Adds a calendar to the collection.
      Parameters:
      cal - business calendar
      Throws:
      RequirementFailure - if the input is null
    • addCalendarFromFile

      public static void addCalendarFromFile(String file)
      Adds a calendar to the collection from a file.
      Parameters:
      file - business calendar file
      Throws:
      RequirementFailure - if the input is null
    • addCalendarFromFile

      public static void addCalendarFromFile(File file)
      Adds a calendar to the collection from a file.
      Parameters:
      file - business calendar file
      Throws:
      RequirementFailure - if the input is null
    • setCalendar

      public static void setCalendar(String name)
      Sets the default calendar by name. The calendar must already be present in the collection.
      Parameters:
      name - calendar name
      See Also:
    • calendar

      public static BusinessCalendar calendar(String name)
      Returns a business calendar.
      Parameters:
      name - name of the calendar. The name is case insensitive.
      Returns:
      business calendar or null if name is null.
      Throws:
      IllegalArgumentException - no calendar matching name
      RequirementFailure - if the input is null
    • calendar

      public static BusinessCalendar calendar()
      Returns the default business calendar.
      Returns:
      default business calendar. The default is specified by the Calendar.default property or setCalendar(String).
      See Also:
    • calendarName

      public static String calendarName()
      Returns the name of the default business calendar.
      Returns:
      name of the default business calendar. The default is specified by the Calendar.default property or setCalendar(String).
      See Also:
    • calendarNames

      public static String[] calendarNames()
      Returns the names of all available calendars
      Returns:
      names of all available calendars