Package com.illumon.util.calendar
Class Calendars
java.lang.Object
com.illumon.util.calendar.Calendars
- All Implemented Interfaces:
Map<String,BusinessCalendar>
public class Calendars extends Object implements Map<String,BusinessCalendar>
A collection of business calendars.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Calendars.StaleHolidayCalendarException
-
Method Summary
Modifier and Type Method Description void
addCalendarFromFile(File file)
Adds a calendar to the collection from thefile
void
addCalendarFromFile(String filePath)
Adds a calendar to the collection from thefilePath
static BusinessCalendar
calendar()
Returns a business calendar.static BusinessCalendar
calendar(String name)
Returns a business calendar.static String[]
calendarNames()
Returns the names of all available calendarsvoid
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<String,BusinessCalendar>>
entrySet()
BusinessCalendar
get(Object key)
static String
getDefaultName()
Returns the default calendar nameboolean
isEmpty()
Set<String>
keySet()
BusinessCalendar
put(String key, BusinessCalendar value)
void
putAll(Map<? extends String,? extends BusinessCalendar> m)
BusinessCalendar
remove(Object key)
int
size()
Collection<BusinessCalendar>
values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
calendar
Returns a business calendar.- Parameters:
name
- name of the calendar- Returns:
- business calendar
- Throws:
IllegalArgumentException
- no calendar matchingname
-
calendar
Returns a business calendar.- Returns:
- default business calendar. The default is specified by the
Calendar.default
property.
-
getDefaultName
Returns the default calendar name- Returns:
- default business calendar name
-
calendarNames
Returns the names of all available calendars- Returns:
- names of all available calendars
-
addCalendarFromFile
Adds a calendar to the collection from thefilePath
- Parameters:
filePath
- must be xml format
-
addCalendarFromFile
Adds a calendar to the collection from thefile
- Parameters:
file
- must be xml format
-
size
public int size()- Specified by:
size
in interfaceMap<String,BusinessCalendar>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceMap<String,BusinessCalendar>
-
containsKey
- Specified by:
containsKey
in interfaceMap<String,BusinessCalendar>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,BusinessCalendar>
-
get
- Specified by:
get
in interfaceMap<String,BusinessCalendar>
-
put
- Specified by:
put
in interfaceMap<String,BusinessCalendar>
-
remove
- Specified by:
remove
in interfaceMap<String,BusinessCalendar>
-
putAll
- Specified by:
putAll
in interfaceMap<String,BusinessCalendar>
-
clear
public void clear()- Specified by:
clear
in interfaceMap<String,BusinessCalendar>
-
keySet
- Specified by:
keySet
in interfaceMap<String,BusinessCalendar>
-
values
- Specified by:
values
in interfaceMap<String,BusinessCalendar>
-
entrySet
- Specified by:
entrySet
in interfaceMap<String,BusinessCalendar>
-