Package clusterless.commons.temporal
Enum IntervalUnit
- java.lang.Object
-
- java.lang.Enum<IntervalUnit>
-
- clusterless.commons.temporal.IntervalUnit
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<IntervalUnit>
,java.time.temporal.TemporalUnit
public enum IntervalUnit extends java.lang.Enum<IntervalUnit> implements java.time.temporal.TemporalUnit
Breaks a day into the number of intervals requested. Fourths is a 15-minute duration, there are 4 Fourths in an hour, and 96 Fourths in a day. Sixths is a 10-minute duration, there are 6 Sixths in an hour, and 144 Sixths in a day. Twelfths is a 5-minute duration, there are 12 Twelfths in an hour, and 288 Twelfth in a day.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R extends java.time.temporal.Temporal>
RaddTo(R temporal, long amount)
long
between(java.time.temporal.Temporal temporal1Inclusive, java.time.temporal.Temporal temporal2Exclusive)
java.time.Duration
getDuration()
boolean
isDateBased()
boolean
isDurationEstimated()
boolean
isSupportedBy(java.time.temporal.Temporal temporal)
boolean
isTimeBased()
java.lang.String
toString()
static IntervalUnit
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static IntervalUnit[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FOURTHS
public static final IntervalUnit FOURTHS
-
SIXTHS
public static final IntervalUnit SIXTHS
-
TWELFTHS
public static final IntervalUnit TWELFTHS
-
-
Method Detail
-
values
public static IntervalUnit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (IntervalUnit c : IntervalUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static IntervalUnit valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getDuration
public java.time.Duration getDuration()
- Specified by:
getDuration
in interfacejava.time.temporal.TemporalUnit
-
isDurationEstimated
public boolean isDurationEstimated()
- Specified by:
isDurationEstimated
in interfacejava.time.temporal.TemporalUnit
-
isDateBased
public boolean isDateBased()
- Specified by:
isDateBased
in interfacejava.time.temporal.TemporalUnit
-
isTimeBased
public boolean isTimeBased()
- Specified by:
isTimeBased
in interfacejava.time.temporal.TemporalUnit
-
isSupportedBy
public boolean isSupportedBy(java.time.temporal.Temporal temporal)
- Specified by:
isSupportedBy
in interfacejava.time.temporal.TemporalUnit
-
addTo
public <R extends java.time.temporal.Temporal> R addTo(R temporal, long amount)
- Specified by:
addTo
in interfacejava.time.temporal.TemporalUnit
-
between
public long between(java.time.temporal.Temporal temporal1Inclusive, java.time.temporal.Temporal temporal2Exclusive)
- Specified by:
between
in interfacejava.time.temporal.TemporalUnit
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfacejava.time.temporal.TemporalUnit
- Overrides:
toString
in classjava.lang.Enum<IntervalUnit>
-
-