public final class LeapSecond extends Object implements IEquatable<LeapSecond>, ImmutableValueType
The International Earth Rotation Service (IERS) periodically introduces an intercalary adjustment to the Coordinated Universal Time (UTC) time scale in order to keep it in close agreement with the Universal Time (UT1) time scale. This adjustment amounts to a one second discontinuity, a leap second, in the UTC time scale that, in addition to the UT1 time scales, also affects transformations to other continuous time scales. Since the inception of leap seconds, all adjustments have been performed either at the end of 30 June or 31 December UTC though a leap second could, by rule, be applied at the end of any month.
LeapSecondFile
Constructor and Description |
---|
LeapSecond()
Initializes a new instance.
|
LeapSecond(double date,
double totalTaiOffsetFromUtc)
Initializes a new instance.
|
LeapSecond(JulianDate date,
double totalTaiOffsetFromUtc)
Initializes a new instance of a Leap Second.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(LeapSecond left,
LeapSecond right)
Returns
true if the two instances are exactly equal. |
boolean |
equals(Object obj)
Indicates whether another object is exactly equal to this instance.
|
boolean |
equalsType(LeapSecond other)
Indicates whether another instance of this type is exactly equal to this instance.
|
JulianDate |
getDate()
Gets the date of the leap second.
|
double |
getTotalTaiOffsetFromUtc()
Gets the total difference TAI - UTC after this leap second, in seconds.
|
int |
hashCode()
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
|
static boolean |
notEquals(LeapSecond left,
LeapSecond right)
Returns
true if the two instances are not exactly equal. |
String |
toString()
Returns the date of this LeapSecond and offset from UTC as a string.
|
public LeapSecond()
public LeapSecond(double date, double totalTaiOffsetFromUtc)
date
- The Julian date of the leap second, in Coordinated Universal Time (UTC).totalTaiOffsetFromUtc
- The offset of TAI from UTC after this leap second.public LeapSecond(@Nonnull JulianDate date, double totalTaiOffsetFromUtc)
date
- The date of the leap second. This date must be in Coordinated Universal Time (UTC).totalTaiOffsetFromUtc
- The offset of TAI from UTC after this leap second.ArgumentException
- Thrown if the given date is not in UTC.@Nonnull public final JulianDate getDate()
public final double getTotalTaiOffsetFromUtc()
public boolean equals(Object obj)
equals
in class Object
obj
- The object to compare to this instance.true
if obj
is an instance of this type and represents the same value as this instance; otherwise false
.Object.hashCode()
,
HashMap
public final boolean equalsType(@Nonnull LeapSecond other)
equalsType
in interface IEquatable<LeapSecond>
other
- The instance to compare to this instance.true
if other
represents the same value as this instance; otherwise false
.public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public String toString()
public static boolean equals(@Nonnull LeapSecond left, @Nonnull LeapSecond right)
true
if the two instances are exactly equal.left
- The instance to compare to right
.right
- The instance to compare to left
.true
if left
represents the same value as right
; otherwise false
.public static boolean notEquals(@Nonnull LeapSecond left, @Nonnull LeapSecond right)
true
if the two instances are not exactly equal.left
- The instance to compare to right
.right
- The instance to compare to left
.true
if left
does not represent the same value as right
; otherwise false
.