Package io.deephaven.time.calendar
Class AbstractCalendar
java.lang.Object
io.deephaven.time.calendar.AbstractCalendar
- All Implemented Interfaces:
Calendar
- Direct Known Subclasses:
AbstractBusinessCalendar
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the day of the week for a time.Gets the day of the week for a time.String[]daysInRange(String start, String end) Gets the days in a given range.String[]daysInRange(Instant start, Instant end) Gets the days in a given range.doubleReturns the amount of time in days betweenstartandend.longReturns the amount of time in nanoseconds betweenstartandend.doublediffYear365(Instant start, Instant end) Returns the number of 365 day years betweenstartandend.doublediffYearAvg(Instant start, Instant end) Returns the number of average (365.2425 day) years betweenstartandend.Gets the next date.Gets the datedaysafter the inputdate.Gets the next date.Gets the datedaysafter the inputtime.intnumberOfDays(String start, String end) Gets the number of days in a given range, end date exclusive.intnumberOfDays(String start, String end, boolean endInclusive) Gets the number of days in a given range.intnumberOfDays(Instant start, Instant end) Gets the number of days in a given range, end date exclusive.intnumberOfDays(Instant start, Instant end, boolean endInclusive) Gets the number of days in a given range.previousDay(String date) Gets the previous date.previousDay(String date, int days) Gets the date the specified number of days prior to the input date.previousDay(Instant time) Gets the previous date.previousDay(Instant time, int days) Gets the date the specified number of days prior to the input date.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.time.calendar.Calendar
currentDay, dayOfWeek, name, nextDay, nextDay, previousDay, previousDay, timeZone
-
Constructor Details
-
AbstractCalendar
public AbstractCalendar()
-
-
Method Details
-
previousDay
Description copied from interface:CalendarGets the previous date.- Specified by:
previousDayin interfaceCalendar- Parameters:
time- time; if null, return null- Returns:
- the day before
time
-
previousDay
Description copied from interface:CalendarGets the date the specified number of days prior to the input date.- Specified by:
previousDayin interfaceCalendar- Parameters:
time- time; if null, return nulldays- number of days;- Returns:
- the date
daysbeforedate
-
previousDay
Description copied from interface:CalendarGets the previous date.- Specified by:
previousDayin interfaceCalendar- Parameters:
date- date; if null, return null- Returns:
- the date before
date
-
previousDay
Description copied from interface:CalendarGets the date the specified number of days prior to the input date.- Specified by:
previousDayin interfaceCalendar- Parameters:
date- date; if null, return nulldays- number of days;- Returns:
- the date
daysbeforedate
-
nextDay
Description copied from interface:CalendarGets the next date. -
nextDay
Description copied from interface:CalendarGets the datedaysafter the inputtime. -
nextDay
Description copied from interface:CalendarGets the next date. -
nextDay
Description copied from interface:CalendarGets the datedaysafter the inputdate. -
daysInRange
Description copied from interface:CalendarGets the days in a given range.- Specified by:
daysInRangein interfaceCalendar- Parameters:
start- start of a time range; if null, return empty arrayend- end of a time range; if null, return empty array- Returns:
- the inclusive days between
startandend
-
daysInRange
Description copied from interface:CalendarGets the days in a given range.- Specified by:
daysInRangein interfaceCalendar- Parameters:
start- start of a time range; if null, return empty arrayend- end of a time range; if null, return empty array- Returns:
- the inclusive days between
startandend
-
numberOfDays
Description copied from interface:CalendarGets the number of days in a given range, end date exclusive.- Specified by:
numberOfDaysin interfaceCalendar- Parameters:
start- start of a time range; if null, returnNULL_INTend- end of a time range; if null, returnNULL_INT- Returns:
- the number days between
startandend, inclusive and exclusive respectively.
-
numberOfDays
Description copied from interface:CalendarGets the number of days in a given range.- Specified by:
numberOfDaysin interfaceCalendar- Parameters:
start- start of a time range; if null, returnNULL_INTend- end of a time range; if null, returnNULL_INTendInclusive- whether to treat theendinclusive or exclusively- Returns:
- the number of days between
startandend, inclusive andendInclusiverespectively.
-
numberOfDays
Description copied from interface:CalendarGets the number of days in a given range, end date exclusive.- Specified by:
numberOfDaysin interfaceCalendar- Parameters:
start- start of a time range; if null, returnNULL_INTend- end of a time range; if null, returnNULL_INT- Returns:
- the number of days between
startandend, inclusive and exclusive respectively.
-
numberOfDays
Description copied from interface:CalendarGets the number of days in a given range.- Specified by:
numberOfDaysin interfaceCalendar- Parameters:
start- start of a time range; if null, returnNULL_INTend- end of a time range; if null, returnNULL_INTendInclusive- whether to treat theendinclusive or exclusively- Returns:
- the number of days between
startandend, inclusive andendInclusiverespectively.
-
diffNanos
Description copied from interface:CalendarReturns the amount of time in nanoseconds betweenstartandend. -
diffDay
Description copied from interface:CalendarReturns the amount of time in days betweenstartandend. -
diffYear365
Description copied from interface:CalendarReturns the number of 365 day years betweenstartandend.- Specified by:
diffYear365in interfaceCalendar- Parameters:
start- start; if null, return nullend- end; if null, return null- Returns:
- the amount of time in years between the
startandend
-
diffYearAvg
Description copied from interface:CalendarReturns the number of average (365.2425 day) years betweenstartandend.- Specified by:
diffYearAvgin interfaceCalendar- Parameters:
start- start; if null, return nullend- end; if null, return null- Returns:
- the amount of time in years between the
startandend
-
dayOfWeek
Description copied from interface:CalendarGets the day of the week for a time. -
dayOfWeek
Description copied from interface:CalendarGets the day of the week for a time.
-