public final class CalendarDays extends Object implements Comparable<CalendarDays>, 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(CalendarDate start,
CalendarDate end)
Calculates the delta of calendar days between given calendar dates.
|
int |
compareTo(CalendarDays other) |
boolean |
equals(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.
|
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(CalendarDate start, CalendarDate end)
Calculates the delta of calendar days between given calendar dates.
start - first calendar date (inclusive)end - second calendar date (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 Comparable<CalendarDays>Copyright © 2014–2017. All rights reserved.