public final class CalendarDateDuration extends Number implements TemporalAmount, CalendarDate.Resolution, Comparable<CalendarDateDuration>
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 |
---|---|
long |
addTo(long epochMilli)
Will increment the input epochMilli by the size/duration of this timeline resolution.
|
Temporal |
addTo(Temporal temporal) |
Temporal |
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()
The size/duration of a timeline resolution "unit".
|
long |
toDurationInNanos() |
String |
toString() |
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
adjustInto
public final double measure
public final CalendarDateUnit unit
public CalendarDateDuration(double aMeasure, CalendarDateUnit aUnit)
public long addTo(long epochMilli)
CalendarDate.Resolution
addTo
in interface CalendarDate.Resolution
public Temporal addTo(Temporal temporal)
addTo
in interface TemporalAmount
public Temporal adjustInto(Temporal temporal)
adjustInto
in interface TemporalAdjuster
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()
CalendarDate.Resolution
toDurationInMillis
in interface CalendarDate.Resolution
public long toDurationInNanos()
toDurationInNanos
in interface CalendarDate.Resolution
Copyright © 2019 Optimatika. All rights reserved.