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 Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChronoUnitprivate final longprivate final longprivate final longprivate final Stringprivate final TimeUnit -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCalendarDateUnit(ChronoUnit chronoUnit, long millis, String label) privateCalendarDateUnit(ChronoUnit chronoUnit, TimeUnit timeUnit, String label) -
Method Summary
Modifier and TypeMethodDescription<R extends Temporal>
RaddTo(R temporal, long amount) longadjustInto(long epochMilli) Maps a range of instances in time to a single instance.adjustInto(Temporal temporal) adjustInto(CalendarDate temporal) longdoubleconvert(double sourceDurationMeasure, CalendarDateUnit sourceDurationUnit) longconvert(long sourceMeassure, CalendarDateUnit sourceUnit) convert(CalendarDateDuration sourceDuration) doubleconvert(CalendarDateUnit aSourceDurationUnit) longcount(long aFromValue, long aToValue) longget(TemporalUnit unit) getLabel()getUnits()booleanbooleanbooleanbooleannewDuration(double meassure) longThe size/duration of a timeline resolution "unit".longstatic CalendarDateUnitReturns 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 Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface CalendarDate.Resolution
addTo, toIndex, toKeyMethods inherited from interface Structure1D.IndexMapper
next, previousMethods inherited from interface 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:
addToin interfaceTemporalUnit
-
adjustInto
- Specified by:
adjustIntoin interfaceCalendarDate.Resolution
-
adjustInto
public long adjustInto(long epochMilli) Description copied from interface:CalendarDate.ResolutionMaps a range of instances in time to a single instance.- Specified by:
adjustIntoin interfaceCalendarDate.Resolution
-
adjustInto
- Specified by:
adjustIntoin interfaceTemporalAdjuster
-
between
- Specified by:
betweenin interfaceTemporalUnit
-
convert
-
convert
-
convert
-
convert
-
count
public long count(long aFromValue, long aToValue) -
get
-
getChronoUnit
-
getDuration
- Specified by:
getDurationin interfaceTemporalUnit
-
getLabel
-
getTimeUnit
-
getUnits
-
isCalendarUnit
public boolean isCalendarUnit() -
isDateBased
public boolean isDateBased()- Specified by:
isDateBasedin interfaceTemporalUnit
-
isDurationEstimated
public boolean isDurationEstimated()- Specified by:
isDurationEstimatedin interfaceTemporalUnit
-
isTimeBased
public boolean isTimeBased()- Specified by:
isTimeBasedin interfaceTemporalUnit
-
newDuration
-
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
-