public final class CalendarDateDuration extends Number implements TemporalAmount, CalendarDate.Resolution, Comparable<CalendarDateDuration>, Serializable
Designed to complement CalendarDate. It is similar to Duration or Period, but supports a decimal/fractional measure. It has been retrofitted to implement the TemporalAmount interface.
CalendarDate
,
CalendarDateUnit
,
Serialized FormModifier and Type | Field and Description |
---|---|
double |
measure |
CalendarDateUnit |
unit |
Constructor and Description |
---|
CalendarDateDuration(double aMeasure,
CalendarDateUnit aUnit) |
Modifier and Type | Method and Description |
---|---|
Temporal |
addTo(Temporal temporal) |
CalendarDate |
adjustInto(Calendar temporal) |
CalendarDate |
adjustInto(Date temporal) |
CalendarDate |
adjustInto(Temporal temporal) |
int |
compareTo(CalendarDateDuration reference) |
CalendarDateDuration |
convertTo(CalendarDateUnit newUnit) |
double |
doubleValue() |
boolean |
equals(Object obj) |
float |
floatValue() |
long |
get(TemporalUnit unit) |
List<TemporalUnit> |
getUnits() |
int |
hashCode() |
int |
intValue() |
long |
longValue() |
Temporal |
subtractFrom(Temporal temporal) |
long |
toDurationInMillis() |
long |
toDurationInNanos() |
String |
toString() |
byteValue, shortValue
public final double measure
public final CalendarDateUnit unit
public CalendarDateDuration(double aMeasure, CalendarDateUnit aUnit)
public Temporal addTo(Temporal temporal)
addTo
in interface TemporalAmount
public CalendarDate adjustInto(Calendar temporal)
adjustInto
in interface CalendarDate.Resolution
public CalendarDate adjustInto(Date temporal)
adjustInto
in interface CalendarDate.Resolution
public CalendarDate adjustInto(Temporal temporal)
adjustInto
in interface TemporalAdjuster
adjustInto
in interface CalendarDate.Resolution
public int compareTo(CalendarDateDuration reference)
compareTo
in interface Comparable<CalendarDateDuration>
public CalendarDateDuration convertTo(CalendarDateUnit newUnit)
public double doubleValue()
doubleValue
in class Number
public float floatValue()
floatValue
in class Number
public long get(TemporalUnit unit)
get
in interface TemporalAmount
public List<TemporalUnit> getUnits()
getUnits
in interface TemporalAmount
public Temporal subtractFrom(Temporal temporal)
subtractFrom
in interface TemporalAmount
public long toDurationInMillis()
toDurationInMillis
in interface CalendarDate.Resolution
public long toDurationInNanos()
toDurationInNanos
in interface CalendarDate.Resolution
Copyright © 2018 Optimatika. All rights reserved.