Package io.deephaven.time.calendar
Class Calendars
java.lang.Object
io.deephaven.time.calendar.Calendars
A collection of business calendars.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds a calendar to the collection.static voidaddCalendarFromFile(File file) Adds a calendar to the collection from a file.static voidaddCalendarFromFile(String file) Adds a calendar to the collection from a file.static BusinessCalendarcalendar()Returns the default business calendar.static BusinessCalendarReturns a business calendar.static StringReturns the name of the default business calendar.static String[]Returns the names of all available calendarsstatic List<BusinessCalendar>Loads the line-separated calendar XML resources from the resource file configuration value "Calendar.importPath".static voidremoveCalendar(String name) Removes a calendar from the collection.static voidsetCalendar(String name) Sets the default calendar by name.
-
Method Details
-
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
Removes a calendar from the collection.- Parameters:
name- calendar name- Throws:
RequirementFailure- if the input is null
-
addCalendar
Adds a calendar to the collection.- Parameters:
cal- business calendar- Throws:
RequirementFailure- if the input is null
-
addCalendarFromFile
Adds a calendar to the collection from a file.- Parameters:
file- business calendar file- Throws:
RequirementFailure- if the input is null
-
addCalendarFromFile
Adds a calendar to the collection from a file.- Parameters:
file- business calendar file- Throws:
RequirementFailure- if the input is null
-
setCalendar
Sets the default calendar by name. The calendar must already be present in the collection.- Parameters:
name- calendar name- See Also:
-
calendar
Returns a business calendar.- Parameters:
name- name of the calendar. The name is case insensitive.- Returns:
- business calendar or
nullifnameisnull. - Throws:
IllegalArgumentException- no calendar matchingnameRequirementFailure- if the input is null
-
calendar
Returns the default business calendar.- Returns:
- default business calendar. The default is specified by the
Calendar.defaultproperty orsetCalendar(String). - See Also:
-
calendarName
Returns the name of the default business calendar.- Returns:
- name of the default business calendar. The default is specified by the
Calendar.defaultproperty orsetCalendar(String). - See Also:
-
calendarNames
Returns the names of all available calendars- Returns:
- names of all available calendars
-