Class MillisecondStoreData
java.lang.Object
org.lukashian.store.MillisecondStoreData
- All Implemented Interfaces:
Serializable
For each
Day and Year, this class stores the number of milliseconds between the start of the calendar (the Lukashian epoch)
and the end of that day or year. It also stores the offset between the Lukashian epoch and the UNIX epoch. An implementation of
MillisecondStoreDataProvider, passed into the constructor, is used to obtain this data.
This class also contains the calculations to convert between UNIX time and Terrestrial Time, which is done by correcting for the appropriate leap seconds. Other conversions are not done. Note that UNIX time is not equal to UTC (https://en.wikipedia.org/wiki/Unix_time#UTC_basis), so corrections for UNIX timestamps from before the leap second era are not necessary, because UNIX time is a fixed number of milliseconds since the UNIX epoch and that's what the mechanism needs; it does not need to know the UTC timestamp.
The constant TAI - TT difference is not corrected for, because that correction is included in the 'unixEpochOffsetMilliseconds'.
MillisecondStoreData is an immutable object.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGets the number of milliseconds from the start of the Lukashian Calendar until now.intgetEpochDayForEpochMilliseconds(long epochMilliseconds) Gets the epoch day that overlaps with the point where the given number of milliseconds have passed since the start of the Lukashian Calendar.longgetEpochMillisecondsForEpochDay(int epochDay) Gets the number of milliseconds from the start of the Lukashian Calendar until the final point of the given day.longgetEpochMillisecondsForYear(int year) Gets the number of milliseconds from the start of the Lukashian Calendar until the final point of the given year.longgetLukashianEpochMilliseconds(long unixEpochMilliseconds) Gets the number of milliseconds from the start of the Lukashian Calendar until the given number of milliseconds from the UNIX Epoch.longgetUnixEpochMilliseconds(long lukashianEpochMilliseconds) Gets the number of milliseconds from the UNIX Epoch until the given number of milliseconds from the Lukashian Epoch.intgetYearForEpochMilliseconds(long epochMilliseconds) Gets the year that overlaps with the point where the given number of milliseconds have passed since the start of the Lukashian Calendar.
-
Constructor Details
-
MillisecondStoreData
-
-
Method Details
-
getUnixEpochMilliseconds
public long getUnixEpochMilliseconds(long lukashianEpochMilliseconds) Gets the number of milliseconds from the UNIX Epoch until the given number of milliseconds from the Lukashian Epoch. -
getLukashianEpochMilliseconds
public long getLukashianEpochMilliseconds(long unixEpochMilliseconds) Gets the number of milliseconds from the start of the Lukashian Calendar until the given number of milliseconds from the UNIX Epoch. -
getCurrentEpochMilliseconds
public long getCurrentEpochMilliseconds()Gets the number of milliseconds from the start of the Lukashian Calendar until now. -
getEpochMillisecondsForYear
public long getEpochMillisecondsForYear(int year) Gets the number of milliseconds from the start of the Lukashian Calendar until the final point of the given year. -
getEpochMillisecondsForEpochDay
public long getEpochMillisecondsForEpochDay(int epochDay) Gets the number of milliseconds from the start of the Lukashian Calendar until the final point of the given day. The day is specified in epoch form, i.e. the how manieth day it is since the start of the Lukashian Calendar, irrespective of the year of the day. -
getYearForEpochMilliseconds
public int getYearForEpochMilliseconds(long epochMilliseconds) Gets the year that overlaps with the point where the given number of milliseconds have passed since the start of the Lukashian Calendar. -
getEpochDayForEpochMilliseconds
public int getEpochDayForEpochMilliseconds(long epochMilliseconds) Gets the epoch day that overlaps with the point where the given number of milliseconds have passed since the start of the Lukashian Calendar.
-