Package com.illumon.util.calendar
Class DefaultNoHolidayBusinessCalendar
java.lang.Object
com.illumon.util.calendar.AbstractCalendar
com.illumon.util.calendar.AbstractBusinessCalendar
com.illumon.util.calendar.DefaultNoHolidayBusinessCalendar
- All Implemented Interfaces:
BusinessCalendar,Calendar
A
BusinessCalendar with no non-business days.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new Default24HourBusinessCalendar instance. -
Method Summary
Modifier and TypeMethodDescriptionlongdiffBusinessNanos(DBDateTime start, DBDateTime end) Returns the amount of business time in nanoseconds betweenstartandend.doublediffBusinessYear(DBDateTime startTime, DBDateTime endTime) Returns the number of business years betweenstartandend.doublediffNonBusinessDay(DBDateTime start, DBDateTime end) Returns the amount of non-business time in standard business days betweenstartandend.longdiffNonBusinessNanos(DBDateTime start, DBDateTime end) Returns the amount of non-business time in nanoseconds betweenstartandend.booleangetBusinessDay(DBDateTime time) Deprecated.getBusinessDay(String date) Deprecated.getBusinessDay(LocalDate date) Deprecated.Gets the indicated business day's schedule.getBusinessSchedule(String date) 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.byte[]For use in the web API server, so we can get the raw calendar data for shipping to clients.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.Gets the next non-business day.nextNonBusinessDay(int days) Gets the non-business datedaysnon-business days after the current day.nextNonBusinessDay(DBDateTime time) Gets the next non-business day.nextNonBusinessDay(DBDateTime time, int days) Gets the non-business datedaysnon-business days after inputtime.nextNonBusinessDay(String date) Gets the next non-business day.nextNonBusinessDay(String date, int days) Gets the non-business datedaysnon-business days after inputdate.String[]nonBusinessDaysInRange(DBDateTime start, DBDateTime end) Returns the non-business days betweenstartandend, inclusive.String[]nonBusinessDaysInRange(String start, String end) Returns the non-business days betweenstartandend, inclusive.intnumberOfNonBusinessDays(DBDateTime start, DBDateTime end) Returns the number of non-business days betweenstartandend.intnumberOfNonBusinessDays(DBDateTime start, DBDateTime end, boolean endInclusive) Returns the number of non-business days betweenstartandend.intnumberOfNonBusinessDays(String start, String end) Returns the number of non-business days betweenstartandend.intnumberOfNonBusinessDays(String start, String end, boolean endInclusive) Returns the number of non-business days betweenstartandend.Gets the previous non-business day.previousNonBusinessDay(int days) Gets the non-business datedaysnon-business days before the current day.Gets the previous non-business day.previousNonBusinessDay(DBDateTime time, int days) Gets the non-business datedaysnon-business days before inputtime.previousNonBusinessDay(String date) Gets the previous non-business day.previousNonBusinessDay(String date, int days) Gets the non-business datedaysnon-business days before inputdate.longReturns the length of a standard business day in nanoseconds.timeZone()Gets the timezone of the calendar.toString()Methods inherited from class com.illumon.util.calendar.AbstractBusinessCalendar
businessDaysInRange, businessDaysInRange, diffBusinessDay, fractionOfBusinessDayComplete, fractionOfBusinessDayRemaining, fractionOfStandardBusinessDay, fractionOfStandardBusinessDay, isBusinessDay, isBusinessDay, isBusinessDay, isBusinessTime, isLastBusinessDayOfMonth, isLastBusinessDayOfMonth, isLastBusinessDayOfWeek, isLastBusinessDayOfWeek, nextBusinessDay, nextBusinessDay, nextBusinessDay, nextBusinessDay, nextBusinessSchedule, nextBusinessSchedule, nextBusinessSchedule, nextBusinessSchedule, numberOfBusinessDays, numberOfBusinessDays, numberOfBusinessDays, numberOfBusinessDays, previousBusinessDay, previousBusinessDay, previousBusinessDay, previousBusinessDay, previousBusinessSchedule, previousBusinessSchedule, previousBusinessSchedule, previousBusinessScheduleMethods inherited from class com.illumon.util.calendar.AbstractCalendar
dayOfWeek, dayOfWeek, daysInRange, daysInRange, diffDay, diffNanos, diffYear, 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 com.illumon.util.calendar.BusinessCalendar
currentBusinessSchedule, fractionOfStandardBusinessDay, getLastHoliday, isBusinessDay, isLastBusinessDayOfMonth, isLastBusinessDayOfWeek, nextBusinessDay, nextBusinessDay, nextBusinessSchedule, nextBusinessSchedule, previousBusinessDay, previousBusinessDay, previousBusinessSchedule, previousBusinessScheduleMethods inherited from interface com.illumon.util.calendar.Calendar
currentDay, dayOfWeek, dayOfWeek, dayOfWeek, daysInRange, daysInRange, diffDay, diffNanos, diffYear, nextDay, nextDay, nextDay, nextDay, nextDay, nextDay, numberOfDays, numberOfDays, numberOfDays, numberOfDays, previousDay, previousDay, previousDay, previousDay, previousDay, previousDay
-
Constructor Details
-
DefaultNoHolidayBusinessCalendar
Creates a new Default24HourBusinessCalendar instance. Assumes thatcalendaris aBusinessCalendarwith no holidays and a 24 hour business day.- Parameters:
calendar-BusinessCalendarwith no holidays and a 24 hour business day
-
-
Method Details
-
getDefaultBusinessPeriods
Description copied from interface:BusinessCalendarGets the business periods for the default days.- 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.- 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.- 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.- Returns:
- the name of the calendar
-
timeZone
Description copied from interface:CalendarGets the timezone of the calendar.- Returns:
- the time zone of the calendar
-
standardBusinessDayLengthNanos
public long standardBusinessDayLengthNanos()Description copied from interface:BusinessCalendarReturns the length of a standard business day in nanoseconds.- Returns:
- length of a standard business day in nanoseconds.
-
getBusinessDay
Deprecated.Description copied from interface:BusinessCalendarGets the indicated business day.- 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.- Parameters:
date- date- Returns:
- the corresponding BusinessSchedule of
date
-
getBusinessDay
Deprecated.Description copied from interface:BusinessCalendarGets the indicated business day.- Parameters:
date- date- Returns:
- the corresponding BusinessSchedule of
date
-
getBusinessSchedule
Description copied from interface:BusinessCalendarGets the indicated business day's schedule.getBusinessSchedule(null)returnsnull.- 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.- Parameters:
date- date- Returns:
- the corresponding BusinessSchedule of
date
-
getBusinessSchedule
Description copied from interface:BusinessCalendarGets the indicated business day's schedule.getBusinessSchedule(null)returnsnull.- Parameters:
date- date- Returns:
- the corresponding BusinessSchedule of
date
-
diffBusinessNanos
Description copied from interface:BusinessCalendarReturns the amount of business time in nanoseconds betweenstartandend.- 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.- 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() -
previousNonBusinessDay
Description copied from interface:BusinessCalendarGets the previous non-business day.- Returns:
- the most recent non-business day before the current day
-
previousNonBusinessDay
Description copied from interface:BusinessCalendarGets the non-business datedaysnon-business days before the current day. Ifdaysis zero and the day is a business day, null is returned.- Parameters:
days- number of days- Returns:
- the non-business date
daysnon-business days before the current day
-
previousNonBusinessDay
Description copied from interface:BusinessCalendarGets the previous non-business day.- Specified by:
previousNonBusinessDayin interfaceBusinessCalendar- Overrides:
previousNonBusinessDayin classAbstractBusinessCalendar- Parameters:
time- time; if null, return null- Returns:
- the most recent non-business day before
time
-
previousNonBusinessDay
Description copied from interface:BusinessCalendarGets the non-business datedaysnon-business days before inputtime. Ifdaysis zero and the day is a business day, null is returned.- Specified by:
previousNonBusinessDayin interfaceBusinessCalendar- Overrides:
previousNonBusinessDayin classAbstractBusinessCalendar- Parameters:
time- time; if null, return nulldays- number of days- Returns:
- the non-business date
daysnon-business days before inputtime
-
previousNonBusinessDay
Description copied from interface:BusinessCalendarGets the previous non-business day.- Specified by:
previousNonBusinessDayin interfaceBusinessCalendar- Overrides:
previousNonBusinessDayin classAbstractBusinessCalendar- Parameters:
date- date; if null, return null- Returns:
- the most recent non-business day before
date
-
previousNonBusinessDay
Description copied from interface:BusinessCalendarGets the non-business datedaysnon-business days before inputdate. Ifdaysis zero and the day is a business day, null is returned.- Specified by:
previousNonBusinessDayin interfaceBusinessCalendar- Overrides:
previousNonBusinessDayin classAbstractBusinessCalendar- Parameters:
date- date; if null, return nulldays- number of days- Returns:
- the non-business date
daysnon-business days before inputdate
-
nextNonBusinessDay
Description copied from interface:BusinessCalendarGets the next non-business day.- Returns:
- the next non-business day after the current day
-
nextNonBusinessDay
Description copied from interface:BusinessCalendarGets the non-business datedaysnon-business days after the current day. Ifdaysis zero and the day is a business day, null is returned.- Parameters:
days- number of days- Returns:
- the non-business date
daysnon-business days after the current day
-
nextNonBusinessDay
Description copied from interface:BusinessCalendarGets the next non-business day.- Specified by:
nextNonBusinessDayin interfaceBusinessCalendar- Overrides:
nextNonBusinessDayin classAbstractBusinessCalendar- Parameters:
time- time; if null, return null- Returns:
- the next non-business day after
time
-
nextNonBusinessDay
Description copied from interface:BusinessCalendarGets the non-business datedaysnon-business days after inputtime. Ifdaysis zero and the day is a business day, null is returned.- Specified by:
nextNonBusinessDayin interfaceBusinessCalendar- Overrides:
nextNonBusinessDayin classAbstractBusinessCalendar- Parameters:
time- time; if null, return nulldays- number of days- Returns:
- the non-business date
daysnon-business days after inputtime
-
nextNonBusinessDay
Description copied from interface:BusinessCalendarGets the next non-business day.- Specified by:
nextNonBusinessDayin interfaceBusinessCalendar- Overrides:
nextNonBusinessDayin classAbstractBusinessCalendar- Parameters:
date- date; if null, return null- Returns:
- the next non-business day after
date
-
nextNonBusinessDay
Description copied from interface:BusinessCalendarGets the non-business datedaysnon-business days after inputdate. Ifdaysis zero and the day is a business day, null is returned.- Specified by:
nextNonBusinessDayin interfaceBusinessCalendar- Overrides:
nextNonBusinessDayin classAbstractBusinessCalendar- Parameters:
date- date; if null, return nulldays- number of days- Returns:
- the most recent business day before
time
-
nonBusinessDaysInRange
Description copied from interface:BusinessCalendarReturns the non-business days betweenstartandend, inclusive. Because no time information (e.g., hours, minutes, seconds) is returned, the corresponding days forstartandendwill be included if they are non-business days.- Specified by:
nonBusinessDaysInRangein interfaceBusinessCalendar- Overrides:
nonBusinessDaysInRangein classAbstractBusinessCalendar- Parameters:
start- start time; if null, return empty arrayend- end time; if null, return empty array- Returns:
- inclusive non-business days between
startandend
-
nonBusinessDaysInRange
Description copied from interface:BusinessCalendarReturns the non-business days betweenstartandend, inclusive. Because no time information (e.g., hours, minutes, seconds) is returned, the corresponding days forstartandendwill be included if they are non-business days.- Specified by:
nonBusinessDaysInRangein interfaceBusinessCalendar- Overrides:
nonBusinessDaysInRangein classAbstractBusinessCalendar- Parameters:
start- start time; if null, return empty arrayend- end time; if null, return empty array- Returns:
- inclusive non-business days between
startandend
-
diffNonBusinessNanos
Description copied from interface:BusinessCalendarReturns the amount of non-business time in nanoseconds betweenstartandend.- Specified by:
diffNonBusinessNanosin interfaceBusinessCalendar- Overrides:
diffNonBusinessNanosin classAbstractBusinessCalendar- Parameters:
start- start time; if null, return NULL_LONGend- end time; if null, return NULL_LONG- Returns:
- the amount of non-business time in nanoseconds between the
startandend
-
diffNonBusinessDay
Description copied from interface:BusinessCalendarReturns the amount of non-business time in standard business days betweenstartandend.- Specified by:
diffNonBusinessDayin interfaceBusinessCalendar- Overrides:
diffNonBusinessDayin classAbstractBusinessCalendar- Parameters:
start- start time; if null, return NULL_LONGend- end time; if null, return NULL_LONG- Returns:
- the amount of non-business time in standard business days between the
startandend
-
numberOfNonBusinessDays
Description copied from interface:BusinessCalendarReturns the number of non-business days betweenstartandend.- Specified by:
numberOfNonBusinessDaysin interfaceBusinessCalendar- Overrides:
numberOfNonBusinessDaysin classAbstractBusinessCalendar- Parameters:
start- start time; if null, return NULL_INTend- end time; if null, return NULL_INT- Returns:
- number of business days between the
startandend, inclusive and exclusive respectively.
-
numberOfNonBusinessDays
Description copied from interface:BusinessCalendarReturns the number of non-business days betweenstartandend.- Specified by:
numberOfNonBusinessDaysin interfaceBusinessCalendar- Overrides:
numberOfNonBusinessDaysin classAbstractBusinessCalendar- Parameters:
start- start time; if null, return NULL_LONGend- end time; if null, return NULL_LONGendInclusive- whether to treat theendinclusive or exclusively- Returns:
- number of business days between the
startandend, inclusive andendInclusiverespectively.
-
numberOfNonBusinessDays
Description copied from interface:BusinessCalendarReturns the number of non-business days betweenstartandend.- Specified by:
numberOfNonBusinessDaysin interfaceBusinessCalendar- Overrides:
numberOfNonBusinessDaysin classAbstractBusinessCalendar- Parameters:
start- start time; if null, return NULL_INTend- end time; if null, return NULL_INT- Returns:
- number of non-business days between the
startandend, inclusive.
-
numberOfNonBusinessDays
Description copied from interface:BusinessCalendarReturns the number of non-business days betweenstartandend.- Specified by:
numberOfNonBusinessDaysin interfaceBusinessCalendar- Overrides:
numberOfNonBusinessDaysin classAbstractBusinessCalendar- Parameters:
start- start time; if null, return NULL_INTend- end time; if null, return NULL_INTendInclusive- whether to treat theendinclusive or exclusively- Returns:
- number of non-business days between the
startandend, inclusive andendInclusiverespectively.
-
getRawData
@NotNull public byte[] getRawData()Description copied from interface:BusinessCalendarFor use in the web API server, so we can get the raw calendar data for shipping to clients.- Returns:
- the raw data used to construct this calendar, may be null if the raw data is not available
-