Package com.illumon.util.calendar
Class AbstractCalendar
java.lang.Object
com.illumon.util.calendar.AbstractCalendar
- All Implemented Interfaces:
Calendar
- Direct Known Subclasses:
AbstractBusinessCalendar
public abstract class AbstractCalendar extends Object implements Calendar
-
Constructor Summary
Constructors Constructor Description AbstractCalendar()
-
Method Summary
Modifier and Type Method Description DayOfWeek
dayOfWeek(DBDateTime time)
Gets the day of the week for a time.DayOfWeek
dayOfWeek(String date)
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.double
diffDay(DBDateTime start, DBDateTime end)
Returns the amount of time in days betweenstart
andend
.long
diffNanos(DBDateTime start, DBDateTime end)
Returns the amount of time in nanoseconds betweenstart
andend
.double
diffYear(DBDateTime start, DBDateTime end)
Returns the number of years betweenstart
andend
.String
nextDay(DBDateTime time)
Gets the next date.String
nextDay(DBDateTime time, int days)
Gets the datedays
after the inputtime
.String
nextDay(String date)
Gets the next date.String
nextDay(String date, int days)
Gets the datedays
after the inputdate
.int
numberOfDays(DBDateTime start, DBDateTime end)
Gets the number of days in a given range, end date exclusive.int
numberOfDays(DBDateTime start, DBDateTime end, boolean endInclusive)
Gets the number of days in a given range.int
numberOfDays(String start, String end)
Gets the number of days in a given range, end date exclusive.int
numberOfDays(String start, String end, boolean endInclusive)
Gets the number of days in a given range.String
previousDay(DBDateTime time)
Gets the previous date.String
previousDay(DBDateTime time, int days)
Gets the date the specified number of days prior to the input date.String
previousDay(String date)
Gets the previous date.String
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, wait
Methods 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:Calendar
Gets the previous date.- Specified by:
previousDay
in interfaceCalendar
- Parameters:
time
- time; if null, return null- Returns:
- the day before
time
-
previousDay
Description copied from interface:Calendar
Gets the date the specified number of days prior to the input date.- Specified by:
previousDay
in interfaceCalendar
- Parameters:
time
- time; if null, return nulldays
- number of days;- Returns:
- the date
days
beforedate
-
previousDay
Description copied from interface:Calendar
Gets the previous date.- Specified by:
previousDay
in interfaceCalendar
- Parameters:
date
- date; if null, return null- Returns:
- the date before
date
-
previousDay
Description copied from interface:Calendar
Gets the date the specified number of days prior to the input date.- Specified by:
previousDay
in interfaceCalendar
- Parameters:
date
- date; if null, return nulldays
- number of days;- Returns:
- the date
days
beforedate
-
nextDay
Description copied from interface:Calendar
Gets the next date. -
nextDay
Description copied from interface:Calendar
Gets the datedays
after the inputtime
. -
nextDay
Description copied from interface:Calendar
Gets the next date. -
nextDay
Description copied from interface:Calendar
Gets the datedays
after the inputdate
. -
daysInRange
Description copied from interface:Calendar
Gets the days in a given range.- Specified by:
daysInRange
in 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
start
andend
-
daysInRange
Description copied from interface:Calendar
Gets the days in a given range.- Specified by:
daysInRange
in 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
start
andend
-
numberOfDays
Description copied from interface:Calendar
Gets the number of days in a given range, end date exclusive.- Specified by:
numberOfDays
in interfaceCalendar
- Parameters:
start
- start of a time range; if null, returnNULL_INT
end
- end of a time range; if null, returnNULL_INT
- Returns:
- the number days between
start
andend
, inclusive and exclusive respectively.
-
numberOfDays
Description copied from interface:Calendar
Gets the number of days in a given range.- Specified by:
numberOfDays
in interfaceCalendar
- Parameters:
start
- start of a time range; if null, returnNULL_INT
end
- end of a time range; if null, returnNULL_INT
endInclusive
- whether to treat theend
inclusive or exclusively- Returns:
- the number of days between
start
andend
, inclusive andendInclusive
respectively.
-
numberOfDays
Description copied from interface:Calendar
Gets the number of days in a given range, end date exclusive.- Specified by:
numberOfDays
in interfaceCalendar
- Parameters:
start
- start of a time range; if null, returnNULL_INT
end
- end of a time range; if null, returnNULL_INT
- Returns:
- the number of days between
start
andend
, inclusive and exclusive respectively.
-
numberOfDays
Description copied from interface:Calendar
Gets the number of days in a given range.- Specified by:
numberOfDays
in interfaceCalendar
- Parameters:
start
- start of a time range; if null, returnNULL_INT
end
- end of a time range; if null, returnNULL_INT
endInclusive
- whether to treat theend
inclusive or exclusively- Returns:
- the number of days between
start
andend
, inclusive andendInclusive
respectively.
-
diffNanos
Description copied from interface:Calendar
Returns the amount of time in nanoseconds betweenstart
andend
. -
diffDay
Description copied from interface:Calendar
Returns the amount of time in days betweenstart
andend
. -
diffYear
Description copied from interface:Calendar
Returns the number of years betweenstart
andend
. -
dayOfWeek
Description copied from interface:Calendar
Gets the day of the week for a time. -
dayOfWeek
Description copied from interface:Calendar
Gets the day of the week for a time.
-