Enum Class TimeUnit
- All Implemented Interfaces:
Serializable, Comparable<TimeUnit>, Constable, TemporalUnit
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescription<R extends Temporal>
RaddTo(R temporal, long amount) longlongbooleanbooleanbooleanlongtoDays(long amount) longtoHours(long amount) longtoMillis(long amount) longtoMinutes(long amount) longtoSeconds(long amount) longtoTicks(long amount) static TimeUnitReturns the enum constant of this class with the specified name.static TimeUnit[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface TemporalUnit
isSupportedBy, toString
-
Enum Constant Details
-
MILLISECONDS
-
TICKS
-
SECONDS
-
MINUTES
-
HOURS
-
DAYS
-
-
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
-
toMillis
public long toMillis(long amount) -
toTicks
public long toTicks(long amount) -
toSeconds
public long toSeconds(long amount) -
toMinutes
public long toMinutes(long amount) -
toHours
public long toHours(long amount) -
toDays
public long toDays(long amount) -
convert
-
getDuration
- Specified by:
getDurationin interfaceTemporalUnit
-
isDurationEstimated
public boolean isDurationEstimated()- Specified by:
isDurationEstimatedin interfaceTemporalUnit
-
isDateBased
public boolean isDateBased()- Specified by:
isDateBasedin interfaceTemporalUnit
-
isTimeBased
public boolean isTimeBased()- Specified by:
isTimeBasedin interfaceTemporalUnit
-
addTo
- Specified by:
addToin interfaceTemporalUnit
-
between
- Specified by:
betweenin interfaceTemporalUnit
-