Enum Class SI
- All Implemented Interfaces:
Serializable
,Comparable<SI>
,java.lang.constant.Constable
,ChronoUnit
Defines the SI-second as the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium 133 atom.
SI-seconds were first officially defined in 1967 so that any reference
before that date are meaningless. Time4J supports SI-seconds first with
the start of UTC epoch 1972-01-01 because especially the
class Moment
stores everything before 1972 in mean solar
seconds.
- Author:
- Meno Hochschild
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Calculates the time distance between given time points in SI-units.double
Defines the typical length of this time unit in seconds without taking into account anomalies like timezone effects or leap seconds.boolean
Queries if this time unit is calendrical respective is at least as long as a calendar day.static SI
Returns the enum constant of this class with the specified name.static SI[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
SECONDS
-
NANOSECONDS
-
-
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
-
between
Calculates the time distance between given time points in SI-units.
- Parameters:
start
- start time pointend
- end time point- Returns:
- count of SI-units between start and end
- Throws:
UnsupportedOperationException
- if any time point is before 1972
-
getLength
public double getLength()Description copied from interface:ChronoUnit
Defines the typical length of this time unit in seconds without taking into account anomalies like timezone effects or leap seconds.
Important note: This method can only yield an estimated value and is not intended to assist in calculations of durations, but only in sorting of units.
- Specified by:
getLength
in interfaceChronoUnit
- Returns:
- estimated decimal value in seconds
-
isCalendrical
public boolean isCalendrical()Description copied from interface:ChronoUnit
Queries if this time unit is calendrical respective is at least as long as a calendar day.
Implementation note: The method must be consistent with the typical length of the unit. The expression
Double.compare(unit.getLength(), 86400.0) >= 0
is equivalent tounit.isCalendrical()
.- Specified by:
isCalendrical
in interfaceChronoUnit
- Returns:
true
if at least as long as a day elsefalse
-