public enum SI extends java.lang.Enum<SI> implements 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.
| Enum Constant and Description |
|---|
NANOSECONDS |
SECONDS |
| Modifier and Type | Method and Description |
|---|---|
long |
between(Moment start,
Moment end)
Calculates the time distance between given time points
in SI-units.
|
double |
getLength()
Defines the typical length of this time unit in seconds without
taking into account anomalies like timezone effects or leap seconds.
|
boolean |
isCalendrical()
Queries if this time unit is calendrical respective is at least
as long as a calendar day.
|
static SI |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static SI[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SI SECONDS
public static final SI NANOSECONDS
public static SI[] values()
for (SI c : SI.values()) System.out.println(c);
public static SI valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic long between(Moment start, Moment end)
Calculates the time distance between given time points in SI-units.
start - start time pointend - end time pointjava.lang.UnsupportedOperationException - if any time point is before 1972public double getLength()
ChronoUnitDefines 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.
getLength in interface ChronoUnitpublic boolean isCalendrical()
ChronoUnitQueries 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 to unit.isCalendrical().
isCalendrical in interface ChronoUnittrue if at least as long as a day else false