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 void
Adds a calendar to the collection.static void
addCalendarFromFile
(File file) Adds a calendar to the collection from a file.static void
addCalendarFromFile
(String file) Adds a calendar to the collection from a file.static BusinessCalendar
calendar()
Returns the default business calendar.static BusinessCalendar
Returns a business calendar.static String
Returns 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 void
removeCalendar
(String name) Removes a calendar from the collection.static void
setCalendar
(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
null
ifname
isnull
. - Throws:
IllegalArgumentException
- no calendar matchingname
RequirementFailure
- if the input is null
-
calendar
Returns the default business calendar.- Returns:
- default business calendar. The default is specified by the
Calendar.default
property 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.default
property orsetCalendar(String)
. - See Also:
-
calendarNames
Returns the names of all available calendars- Returns:
- names of all available calendars
-