Package com.illumon.util.calendar
Class AbstractCalendar
java.lang.Object
com.illumon.util.calendar.AbstractCalendar
- All Implemented Interfaces:
Calendar
- Direct Known Subclasses:
AbstractBusinessCalendar
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondayOfWeek(DBDateTime time) Gets the day of the week for a time.Gets the day of the week for a time.String[]daysInRange(DBDateTime start, DBDateTime end) Gets the days in a given range.String[]daysInRange(String start, String end) Gets the days in a given range.doublediffDay(DBDateTime start, DBDateTime end) Returns the amount of time in days betweenstartandend.longdiffNanos(DBDateTime start, DBDateTime end) Returns the amount of time in nanoseconds betweenstartandend.doublediffYear(DBDateTime start, DBDateTime end) Returns the number of years betweenstartandend.nextDay(DBDateTime time) Gets the next date.nextDay(DBDateTime time, int days) Gets the datedaysafter the inputtime.Gets the next date.Gets the datedaysafter the inputdate.intnumberOfDays(DBDateTime start, DBDateTime end) Gets the number of days in a given range, end date exclusive.intnumberOfDays(DBDateTime start, DBDateTime end, boolean endInclusive) Gets the number of days in a given range.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.previousDay(DBDateTime time) Gets the previous date.previousDay(DBDateTime time, int days) Gets the date the specified number of days prior to the input date.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.util.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. -
diffYear
Description copied from interface:CalendarReturns the number of years betweenstartandend. -
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.
-