astronomical_calendar library

Classes

AstronomicalCalendar
A Java calendar that calculates astronomical times such as {@link #getSunrise() sunrise}, {@link #getSunset() sunset} and twilight times. This class contains a {@link #getCalendar() Calendar} and can therefore use the standard Calendar functionality to change dates etc... The calculation engine used to calculate the astronomical times can be changed to a different implementation by implementing the abstract {@link AstronomicalCalculator} and setting it with the {@link #setAstronomicalCalculator(AstronomicalCalculator)}. A number of different calculation engine implementations are included in the util package. Note: There are times when the algorithms can't calculate proper values for sunrise, sunset and twilight. This is usually caused by trying to calculate times for areas either very far North or South, where sunrise / sunset never happen on that date. This is common when calculating twilight with a deep dip below the horizon for locations as far south of the North Pole as London, in the northern hemisphere. The sun never reaches this dip at certain times of the year. When the calculations encounter this condition a null will be returned when a {@link java.util.Date} is expected and {@link Long#MIN_VALUE} when a long is expected. The reason that Exceptions are not thrown in these cases is because the lack of a rise/set or twilight is not an exception, but an expected condition in many parts of the world. [...]