public final class CalendarDays extends java.lang.Object implements java.lang.Comparable<CalendarDays>, java.io.Serializable
Represents a count of calendar days.
| Modifier and Type | Field and Description |
|---|---|
static CalendarDays |
ONE
Represents exactly one calendar day.
|
static CalendarDays |
ZERO
Represents zero calendar days.
|
| Modifier and Type | Method and Description |
|---|---|
CalendarDays |
abs()
Yields the absolute value of the represented calendar days.
|
static CalendarDays |
between(CalendarVariant<?> start,
CalendarVariant<?> end)
Calculates the delta of calendar days between given calendar variants.
|
static CalendarDays |
between(Calendrical<?,?> start,
Calendrical<?,?> end)
Calculates the delta of calendar days between given calendrical time points.
|
int |
compareTo(CalendarDays other) |
boolean |
equals(java.lang.Object obj) |
long |
getAmount()
Yields the calendar days as primitive.
|
int |
hashCode() |
boolean |
isNegative()
Is the count of calendar days smaller than zero?
|
boolean |
isZero()
Is the count of calendar days equal to zero?
|
CalendarDays |
minus(CalendarDays other)
Yields the delta of the represented calendar days of this instance and given argument.
|
static CalendarDays |
of(long days)
Wraps given count of calendar days.
|
CalendarDays |
plus(CalendarDays other)
Yields the sum of the represented calendar days of this instance and given argument.
|
java.lang.String |
toString()
Returns an ISO-8601-like duration representation in format "[-]P{n}D".
|
public static final CalendarDays ZERO
public static final CalendarDays ONE
public static CalendarDays of(long days)
Wraps given count of calendar days.
days - count of calendar daysCalendarDayspublic long getAmount()
Yields the calendar days as primitive.
public boolean isZero()
Is the count of calendar days equal to zero?
public boolean isNegative()
Is the count of calendar days smaller than zero?
public static CalendarDays between(CalendarVariant<?> start, CalendarVariant<?> end)
Calculates the delta of calendar days between given calendar variants.
start - first calendar variant (inclusive)end - second calendar variant (exclusive)public static CalendarDays between(Calendrical<?,?> start, Calendrical<?,?> end)
Calculates the delta of calendar days between given calendrical time points.
start - first calendrical time point (inclusive)end - second calendrical time point (exclusive)public CalendarDays abs()
Yields the absolute value of the represented calendar days.
public CalendarDays plus(CalendarDays other)
Yields the sum of the represented calendar days of this instance and given argument.
other - calendar days to be addedpublic CalendarDays minus(CalendarDays other)
Yields the delta of the represented calendar days of this instance and given argument.
other - calendar days to be subtractedpublic int compareTo(CalendarDays other)
compareTo in interface java.lang.Comparable<CalendarDays>public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
Returns an ISO-8601-like duration representation in format "[-]P{n}D".
toString in class java.lang.Object