Package io.deephaven.time.calendar
Class DefaultBusinessCalendar
java.lang.Object
io.deephaven.time.calendar.AbstractCalendar
io.deephaven.time.calendar.AbstractBusinessCalendar
io.deephaven.time.calendar.DefaultBusinessCalendar
- All Implemented Interfaces:
BusinessCalendar,Calendar,Serializable
Default implementation for a
BusinessCalendar. This implementation is thread safe.
Overrides many default Calendar and BusinessCalendar methods for improved performance. See the documentation
of Calendar for details.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionlongdiffBusinessNanos(Instant start, Instant end) Returns the amount of business time in nanoseconds betweenstartandend.doublediffBusinessYear(Instant startTime, Instant endTime) Returns the number of business years betweenstartandend.booleangetBusinessDay(String date) Deprecated.getBusinessDay(Instant time) Deprecated.getBusinessDay(LocalDate date) Deprecated.getBusinessSchedule(String date) Gets the indicated business day's schedule.getBusinessSchedule(Instant time) Gets the indicated business day's schedule.getBusinessSchedule(LocalDate date) Gets the indicated business day's schedule.Gets the business periods for the default days.Gets business schedules for dates that are different from the defaults.inthashCode()booleanisBusinessDay(DayOfWeek day) Is the day of the week a business day? A business day is a day that has a business schedule with one or more business periods defined.name()Gets the name of the calendar.longReturns the length of a standard business day in nanoseconds.timeZone()Gets the timezone of the calendar.toString()Methods inherited from class io.deephaven.time.calendar.AbstractBusinessCalendar
businessDaysInRange, businessDaysInRange, diffBusinessDay, diffNonBusinessDay, diffNonBusinessNanos, fractionOfBusinessDayComplete, fractionOfBusinessDayRemaining, fractionOfStandardBusinessDay, fractionOfStandardBusinessDay, isBusinessDay, isBusinessDay, isBusinessDay, isBusinessTime, isLastBusinessDayOfMonth, isLastBusinessDayOfMonth, isLastBusinessDayOfWeek, isLastBusinessDayOfWeek, nextBusinessDay, nextBusinessDay, nextBusinessDay, nextBusinessDay, nextBusinessSchedule, nextBusinessSchedule, nextBusinessSchedule, nextBusinessSchedule, nextNonBusinessDay, nextNonBusinessDay, nextNonBusinessDay, nextNonBusinessDay, nonBusinessDaysInRange, nonBusinessDaysInRange, numberOfBusinessDays, numberOfBusinessDays, numberOfBusinessDays, numberOfBusinessDays, numberOfNonBusinessDays, numberOfNonBusinessDays, numberOfNonBusinessDays, numberOfNonBusinessDays, previousBusinessDay, previousBusinessDay, previousBusinessDay, previousBusinessDay, previousBusinessSchedule, previousBusinessSchedule, previousBusinessSchedule, previousBusinessSchedule, previousNonBusinessDay, previousNonBusinessDay, previousNonBusinessDay, previousNonBusinessDayMethods inherited from class io.deephaven.time.calendar.AbstractCalendar
dayOfWeek, dayOfWeek, daysInRange, daysInRange, diffDay, diffNanos, diffYear365, diffYearAvg, nextDay, nextDay, nextDay, nextDay, numberOfDays, numberOfDays, numberOfDays, numberOfDays, previousDay, previousDay, previousDay, previousDayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.time.calendar.BusinessCalendar
currentBusinessSchedule, fractionOfStandardBusinessDay, isBusinessDay, isLastBusinessDayOfMonth, isLastBusinessDayOfWeek, nextBusinessDay, nextBusinessDay, nextBusinessSchedule, nextBusinessSchedule, nextNonBusinessDay, nextNonBusinessDay, previousBusinessDay, previousBusinessDay, previousBusinessSchedule, previousBusinessSchedule, previousNonBusinessDay, previousNonBusinessDayMethods inherited from interface io.deephaven.time.calendar.Calendar
currentDay, dayOfWeek, dayOfWeek, dayOfWeek, daysInRange, daysInRange, diffDay, diffNanos, diffYear365, diffYearAvg, nextDay, nextDay, nextDay, nextDay, nextDay, nextDay, numberOfDays, numberOfDays, numberOfDays, numberOfDays, previousDay, previousDay, previousDay, previousDay, previousDay, previousDay
-
Method Details
-
getDefaultBusinessPeriods
Description copied from interface:BusinessCalendarGets the business periods for the default days.- Specified by:
getDefaultBusinessPeriodsin interfaceBusinessCalendar- Returns:
- a list of strings with a comma separating open and close times
-
getHolidays
Description copied from interface:BusinessCalendarGets business schedules for dates that are different from the defaults. This returns all dates that are defined as a holiday for the calendar.- Specified by:
getHolidaysin interfaceBusinessCalendar- Returns:
- a map of dates and to their business periods
-
isBusinessDay
Description copied from interface:BusinessCalendarIs the day of the week a business day? A business day is a day that has a business schedule with one or more business periods defined.- Specified by:
isBusinessDayin interfaceBusinessCalendar- Parameters:
day- a day of the week- Returns:
- true if the day is a business day; false otherwise.
-
name
Description copied from interface:CalendarGets the name of the calendar. -
timeZone
Description copied from interface:CalendarGets the timezone of the calendar. -
standardBusinessDayLengthNanos
public long standardBusinessDayLengthNanos()Description copied from interface:BusinessCalendarReturns the length of a standard business day in nanoseconds.- Specified by:
standardBusinessDayLengthNanosin interfaceBusinessCalendar- Returns:
- length of a standard business day in nanoseconds.
-
getBusinessDay
Deprecated.Description copied from interface:BusinessCalendarGets the indicated business day.- Specified by:
getBusinessDayin interfaceBusinessCalendar- Parameters:
time- time- Returns:
- the corresponding BusinessSchedule of
time; null if time is null
-
getBusinessDay
Deprecated.Description copied from interface:BusinessCalendarGets the indicated business day.- Specified by:
getBusinessDayin interfaceBusinessCalendar- Parameters:
date- date- Returns:
- the corresponding BusinessSchedule of
date
-
getBusinessDay
Deprecated.Description copied from interface:BusinessCalendarGets the indicated business day.- Specified by:
getBusinessDayin interfaceBusinessCalendar- Parameters:
date- date- Returns:
- the corresponding BusinessSchedule of
date
-
getBusinessSchedule
Description copied from interface:BusinessCalendarGets the indicated business day's schedule.getBusinessSchedule(null)returnsnull.- Specified by:
getBusinessSchedulein interfaceBusinessCalendar- Parameters:
time- time- Returns:
- the corresponding BusinessSchedule of
time; null if time is null
-
getBusinessSchedule
Description copied from interface:BusinessCalendarGets the indicated business day's schedule.getBusinessSchedule(null)returnsnull.- Specified by:
getBusinessSchedulein interfaceBusinessCalendar- Parameters:
date- date- Returns:
- the corresponding BusinessSchedule of
date
-
getBusinessSchedule
Description copied from interface:BusinessCalendarGets the indicated business day's schedule.getBusinessSchedule(null)returnsnull.- Specified by:
getBusinessSchedulein interfaceBusinessCalendar- Parameters:
date- date- Returns:
- the corresponding BusinessSchedule of
date
-
diffBusinessNanos
Description copied from interface:BusinessCalendarReturns the amount of business time in nanoseconds betweenstartandend.- Specified by:
diffBusinessNanosin interfaceBusinessCalendar- Parameters:
start- start time; if null, return NULL_LONGend- end time; if null, return NULL_LONG- Returns:
- the amount of business time in nanoseconds between the
startandend
-
diffBusinessYear
Description copied from interface:BusinessCalendarReturns the number of business years betweenstartandend.- Specified by:
diffBusinessYearin interfaceBusinessCalendar- Parameters:
startTime- start; if null, return nullendTime- end; if null, return null- Returns:
- the amount of business time in business years between the
startandend
-
toString
-
equals
-
hashCode
public int hashCode()
-