Package org.ojalgo.type
Enum Class CalendarDateUnit
- All Implemented Interfaces:
Serializable
,Comparable<CalendarDateUnit>
,Constable
,TemporalAdjuster
,TemporalUnit
,Structure1D.IndexMapper<CalendarDate>
,CalendarDate.Resolution
public enum CalendarDateUnit
extends Enum<CalendarDateUnit>
implements TemporalUnit, CalendarDate.Resolution
Designed to complement CalendarDate. It is essentially equivalent to ChronoUnit, but with a slightly smaller set of members (and the additional QUARTER). It has been retrofitted to implement the TemporalUnit interface.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChronoUnit
private final long
private final long
private final long
private final String
private final TimeUnit
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CalendarDateUnit
(ChronoUnit chronoUnit, long millis, String label) private
CalendarDateUnit
(ChronoUnit chronoUnit, TimeUnit timeUnit, String label) -
Method Summary
Modifier and TypeMethodDescription<R extends Temporal>
RaddTo
(R temporal, long amount) long
adjustInto
(long epochMilli) Maps a range of instances in time to a single instance.adjustInto
(Temporal temporal) adjustInto
(CalendarDate temporal) long
double
convert
(double sourceDurationMeasure, CalendarDateUnit sourceDurationUnit) long
convert
(long sourceMeassure, CalendarDateUnit sourceUnit) convert
(CalendarDateDuration sourceDuration) double
convert
(CalendarDateUnit aSourceDurationUnit) long
count
(long aFromValue, long aToValue) long
get
(TemporalUnit unit) getLabel()
getUnits()
boolean
boolean
boolean
boolean
newDuration
(double meassure) long
The size/duration of a timeline resolution "unit".long
static CalendarDateUnit
Returns the enum constant of this class with the specified name.static CalendarDateUnit[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface org.ojalgo.type.CalendarDate.Resolution
addTo, toIndex, toKey
Methods inherited from interface org.ojalgo.structure.Structure1D.IndexMapper
next, previous
Methods inherited from interface java.time.temporal.TemporalUnit
isSupportedBy, toString
-
Enum Constant Details
-
NANOS
-
MICROS
-
MILLIS
-
SECOND
-
MINUTE
-
HOUR
-
DAY
-
WEEK
-
MONTH
-
QUARTER
-
YEAR
-
DECADE
-
CENTURY
-
MILLENIUM
-
-
Field Details
-
myChronoUnit
-
myDurationInMillis
private final long myDurationInMillis -
myDurationInNanos
private final long myDurationInNanos -
myHalf
private final long myHalf -
myLabel
-
myTimeUnit
-
-
Constructor Details
-
CalendarDateUnit
-
CalendarDateUnit
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
addTo
- Specified by:
addTo
in interfaceTemporalUnit
-
adjustInto
- Specified by:
adjustInto
in interfaceCalendarDate.Resolution
-
adjustInto
public long adjustInto(long epochMilli) Description copied from interface:CalendarDate.Resolution
Maps a range of instances in time to a single instance.- Specified by:
adjustInto
in interfaceCalendarDate.Resolution
-
adjustInto
- Specified by:
adjustInto
in interfaceTemporalAdjuster
-
between
- Specified by:
between
in interfaceTemporalUnit
-
convert
-
convert
-
convert
-
convert
-
count
public long count(long aFromValue, long aToValue) -
get
-
getChronoUnit
-
getDuration
- Specified by:
getDuration
in interfaceTemporalUnit
-
getLabel
-
getTimeUnit
-
getUnits
-
isCalendarUnit
public boolean isCalendarUnit() -
isDateBased
public boolean isDateBased()- Specified by:
isDateBased
in interfaceTemporalUnit
-
isDurationEstimated
public boolean isDurationEstimated()- Specified by:
isDurationEstimated
in interfaceTemporalUnit
-
isTimeBased
public boolean isTimeBased()- Specified by:
isTimeBased
in interfaceTemporalUnit
-
newDuration
-
toDurationInMillis
public long toDurationInMillis()Description copied from interface:CalendarDate.Resolution
The size/duration of a timeline resolution "unit".- Specified by:
toDurationInMillis
in interfaceCalendarDate.Resolution
-
toDurationInNanos
public long toDurationInNanos()- Specified by:
toDurationInNanos
in interfaceCalendarDate.Resolution
-