Package net.time4j.engine
Class CalendarDays
java.lang.Object
net.time4j.engine.CalendarDays
- All Implemented Interfaces:
Serializable
,Comparable<CalendarDays>
Represents a count of calendar days.
- Since:
- 3.4/4.3
- Author:
- Meno Hochschild
- See Also:
Calendrical.plus(CalendarDays)
,Calendrical.minus(CalendarDays)
,CalendarVariant.plus(CalendarDays)
,CalendarVariant.minus(CalendarDays)
, Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionstatic CalendarDays
Represents exactly one calendar day.static CalendarDays
Represents zero calendar days. -
Method Summary
Modifier and TypeMethodDescriptionabs()
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
long
Yields the calendar days as primitive.int
hashCode()
inverse()
Negates this duration if not zero.boolean
Is the count of calendar days smaller than zero?boolean
isZero()
Is the count of calendar days equal to zero?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.plus(CalendarDays other)
Yields the sum of the represented calendar days of this instance and given argument.toString()
Returns an ISO-8601-like duration representation in format "[-]P{n}D".
-
Field Details
-
ZERO
Represents zero calendar days. -
ONE
Represents exactly one calendar day.
-
-
Method Details
-
of
Wraps given count of calendar days.
- Parameters:
days
- count of calendar days- Returns:
- new or cached instance of
CalendarDays
- Since:
- 3.4/4.3
-
getAmount
public long getAmount()Yields the calendar days as primitive.
- Returns:
- count of calendar days, maybe zero or negative
- Since:
- 3.4/4.3
-
isZero
public boolean isZero()Is the count of calendar days equal to zero?
- Returns:
- boolean
- Since:
- 3.4/4.3
-
isNegative
public boolean isNegative()Is the count of calendar days smaller than zero?
- Returns:
- boolean
- Since:
- 3.4/4.3
-
between
Calculates the delta of calendar days between given calendar dates.
- Parameters:
start
- first calendar date (inclusive)end
- second calendar date (exclusive)- Returns:
- count of calendar days between start and end
- Since:
- 3.8/4.5
-
abs
Yields the absolute value of the represented calendar days.
- Returns:
- non-negative count of calendar days
- Since:
- 3.4/4.3
-
inverse
Negates this duration if not zero.
- Returns:
- inversed count of calendar days
- Since:
- 5.0
-
plus
Yields the sum of the represented calendar days of this instance and given argument.
- Parameters:
other
- calendar days to be added- Returns:
- sum of calendar days
- Since:
- 3.4/4.3
-
minus
Yields the delta of the represented calendar days of this instance and given argument.
- Parameters:
other
- calendar days to be subtracted- Returns:
- delta of calendar days
- Since:
- 3.4/4.3
-
compareTo
- Specified by:
compareTo
in interfaceComparable<CalendarDays>
-
equals
-
hashCode
public int hashCode() -
toString
Returns an ISO-8601-like duration representation in format "[-]P{n}D".
-