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 classCalendars.StaleHolidayCalendarException -
Method Summary
Modifier and Type Method Description voidaddCalendarFromFile(File file)Adds a calendar to the collection from thefilevoidaddCalendarFromFile(String filePath)Adds a calendar to the collection from thefilePathstatic BusinessCalendarcalendar()Returns a business calendar.static BusinessCalendarcalendar(String name)Returns a business calendar.static String[]calendarNames()Returns the names of all available calendarsvoidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<String,BusinessCalendar>>entrySet()BusinessCalendarget(Object key)static StringgetDefaultName()Returns the default calendar namebooleanisEmpty()Set<String>keySet()BusinessCalendarput(String key, BusinessCalendar value)voidputAll(Map<? extends String,? extends BusinessCalendar> m)BusinessCalendarremove(Object key)intsize()Collection<BusinessCalendar>values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.defaultproperty.
-
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:
sizein interfaceMap<String,BusinessCalendar>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceMap<String,BusinessCalendar>
-
containsKey
- Specified by:
containsKeyin interfaceMap<String,BusinessCalendar>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,BusinessCalendar>
-
get
- Specified by:
getin interfaceMap<String,BusinessCalendar>
-
put
- Specified by:
putin interfaceMap<String,BusinessCalendar>
-
remove
- Specified by:
removein interfaceMap<String,BusinessCalendar>
-
putAll
- Specified by:
putAllin interfaceMap<String,BusinessCalendar>
-
clear
public void clear()- Specified by:
clearin interfaceMap<String,BusinessCalendar>
-
keySet
- Specified by:
keySetin interfaceMap<String,BusinessCalendar>
-
values
- Specified by:
valuesin interfaceMap<String,BusinessCalendar>
-
entrySet
- Specified by:
entrySetin interfaceMap<String,BusinessCalendar>
-