Interface MillisecondStoreDataProvider
- All Known Implementing Classes:
ExternalResourceMillisecondStoreDataProvider, FileMillisecondStoreDataProvider, HttpMillisecondStoreDataProvider, StandardEarthHttpMillisecondStoreDataProvider, StandardEarthMillisecondStoreDataProvider, StandardMarsHttpMillisecondStoreDataProvider, StandardMarsMillisecondStoreDataProvider
public interface MillisecondStoreDataProvider
For each
Day and Year, an instance of this class provices the number of milliseconds between the start of the calendar
(the Lukashian epoch) and the end of that day or year (we call this 'epoch milliseconds'). It also stores the offset between the Lukashian
epoch and the UNIX epoch. Using these numbers, the actual years and days of the Lukashian Calendar are defined. An implementation of
MillisecondStoreDataProvider has to provide the following data:
- The number of epoch milliseconds for each year in an array where the index + 1 is the year and the value is the number of epoch milliseconds for that year, i.e. how many milliseconds have passed from the beginning of the calendar up until the final point of that year.
- The number of epoch milliseconds for each day in an array where the index + 1 is the epoch day and the value is the number of epoch milliseconds for that day, i.e. how many milliseconds have passed from the beginning of the calendar up until the final point of that day. This does not take into account the year that each day is in, it simply lists all days in the calendar (epoch days).
- The offset in milliseconds between the Lukashian epoch (i.e. the start of the Lukashian Calendar) and the UNIX epoch in such a way that "unixEpochOffsetMilliseconds + millisecondsSinceUnixEpoch = millisecondsSinceLukashianEpoch", in other words, when the UNIX epoch is AFTER the Lukashian epoch, it needs to be a positive number. It needs to be measured around the point of the UNIX epoch, before any UNIX leap seconds were added.
CalendarKeys for the
various instances that are available by default.
The Lukashian Calendar Mechanism assumes that each year and each day is at least 3 milliseconds long, i.e. there's a first millisecond, a last one and at least one in between. It might work for years and days that last less than 3 milliseconds, but this has not been tested and is not guaranteed.
Following the previous constraint, The Lukashian Calendar Mechanism also assumes that each year is at least 3 days long, i.e. there's a first day, a last one and at least one in between.
Implementations of this interface do not have to provide any caching functionality: each method is called only once and the result is
stored for future reference by the MillisecondStore.
-
Method Summary
Modifier and TypeMethodDescriptionlong[]loadDayEpochMilliseconds(long[] yearEpochMilliseconds) longlong[]
-
Method Details
-
loadUnixEpochOffsetMilliseconds
long loadUnixEpochOffsetMilliseconds() -
loadYearEpochMilliseconds
long[] loadYearEpochMilliseconds() -
loadDayEpochMilliseconds
long[] loadDayEpochMilliseconds(long[] yearEpochMilliseconds)
-