- java.lang.Object
-
- org.ojalgo.type.CalendarDateDuration
-
- All Implemented Interfaces:
java.lang.Comparable<CalendarDateDuration>,java.time.temporal.TemporalAdjuster,java.time.temporal.TemporalAmount,Structure1D.IndexMapper<CalendarDate>,CalendarDate.Resolution,ComparableNumber<CalendarDateDuration>,NumberDefinition
public final class CalendarDateDuration extends java.lang.Object implements java.time.temporal.TemporalAmount, CalendarDate.Resolution, ComparableNumber<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.
- See Also:
CalendarDate,CalendarDateUnit
-
-
Field Summary
Fields Modifier and Type Field Description doublemeasureCalendarDateUnitunit
-
Constructor Summary
Constructors Constructor Description CalendarDateDuration()CalendarDateDuration(double aMeasure, CalendarDateUnit aUnit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longaddTo(long epochMilli)Will increment the input epochMilli by the size/duration of this timeline resolution.java.time.temporal.TemporaladdTo(java.time.temporal.Temporal temporal)java.time.temporal.TemporaladjustInto(java.time.temporal.Temporal temporal)intcompareTo(CalendarDateDuration reference)CalendarDateDurationconvertTo(CalendarDateUnit newUnit)doubledoubleValue()booleanequals(java.lang.Object obj)floatfloatValue()longget(java.time.temporal.TemporalUnit unit)java.util.List<java.time.temporal.TemporalUnit>getUnits()inthashCode()intintValue()longlongValue()(package private) static CalendarDateDurationof(long nanos)java.time.temporal.TemporalsubtractFrom(java.time.temporal.Temporal temporal)longtoDurationInMillis()The size/duration of a timeline resolution "unit".longtoDurationInNanos()java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ojalgo.type.CalendarDate.Resolution
adjustInto, adjustInto, toIndex, toKey
-
Methods inherited from interface org.ojalgo.type.NumberDefinition
booleanValue, byteValue, shortValue
-
Methods inherited from interface org.ojalgo.structure.Structure1D.IndexMapper
next, previous
-
-
-
-
Field Detail
-
measure
public final double measure
-
unit
public final CalendarDateUnit unit
-
-
Constructor Detail
-
CalendarDateDuration
public CalendarDateDuration(double aMeasure, CalendarDateUnit aUnit)
-
CalendarDateDuration
CalendarDateDuration()
-
-
Method Detail
-
of
static CalendarDateDuration of(long nanos)
-
addTo
public long addTo(long epochMilli)
Description copied from interface:CalendarDate.ResolutionWill increment the input epochMilli by the size/duration of this timeline resolution.- Specified by:
addToin interfaceCalendarDate.Resolution
-
addTo
public java.time.temporal.Temporal addTo(java.time.temporal.Temporal temporal)
- Specified by:
addToin interfacejava.time.temporal.TemporalAmount
-
adjustInto
public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal temporal)
- Specified by:
adjustIntoin interfacejava.time.temporal.TemporalAdjuster
-
compareTo
public int compareTo(CalendarDateDuration reference)
- Specified by:
compareToin interfacejava.lang.Comparable<CalendarDateDuration>
-
convertTo
public CalendarDateDuration convertTo(CalendarDateUnit newUnit)
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein interfaceNumberDefinition
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
floatValue
public float floatValue()
- Specified by:
floatValuein interfaceNumberDefinition
-
get
public long get(java.time.temporal.TemporalUnit unit)
- Specified by:
getin interfacejava.time.temporal.TemporalAmount
-
getUnits
public java.util.List<java.time.temporal.TemporalUnit> getUnits()
- Specified by:
getUnitsin interfacejava.time.temporal.TemporalAmount
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
intValue
public int intValue()
- Specified by:
intValuein interfaceNumberDefinition
-
longValue
public long longValue()
- Specified by:
longValuein interfaceNumberDefinition
-
subtractFrom
public java.time.temporal.Temporal subtractFrom(java.time.temporal.Temporal temporal)
- Specified by:
subtractFromin interfacejava.time.temporal.TemporalAmount
-
toDurationInMillis
public long toDurationInMillis()
Description copied from interface:CalendarDate.ResolutionThe size/duration of a timeline resolution "unit".- Specified by:
toDurationInMillisin interfaceCalendarDate.Resolution
-
toDurationInNanos
public long toDurationInNanos()
- Specified by:
toDurationInNanosin interfaceCalendarDate.Resolution
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-