Package org.shredzone.commons.suncalc
Class SunTimes
java.lang.Object
org.shredzone.commons.suncalc.SunTimes
Calculates the rise and set times of the sun.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Collects all parameters forSunTimes
.static enum
Enumeration of predefined twilights. -
Method Summary
Modifier and TypeMethodDescriptionstatic SunTimes.Parameters
compute()
Starts the computation ofSunTimes
.getNadir()
The time when the sun reaches its lowest point within the next 24 hours.getNoon()
The time when the sun reaches its highest point within the next 24 hours.getRise()
Sunrise time.getSet()
Sunset time.boolean
true
if the sun never rises/sets, but is always below the twilight angle within the next 24 hours.boolean
true
if the sun never rises/sets, but is always above the twilight angle within the next 24 hours.toString()
-
Method Details
-
compute
Starts the computation ofSunTimes
.- Returns:
SunTimes.Parameters
to set.
-
getRise
Sunrise time.null
if the sun does not rise that day.Always returns a sunrise time if
SunTimes.Parameters.fullCycle()
was set. -
getSet
Sunset time.null
if the sun does not set that day.Always returns a sunset time if
SunTimes.Parameters.fullCycle()
was set. -
getNoon
The time when the sun reaches its highest point within the next 24 hours.Use
isAlwaysDown()
to find out if the highest point is still below the twilight angle.Note that
SunTimes.Parameters.fullCycle()
does not affect this result. -
getNadir
The time when the sun reaches its lowest point within the next 24 hours.Use
isAlwaysUp()
to find out if the lowest point is still above the twilight angle.Note that
SunTimes.Parameters.fullCycle()
does not affect this result. -
isAlwaysUp
true
if the sun never rises/sets, but is always above the twilight angle within the next 24 hours.Note that
SunTimes.Parameters.fullCycle()
does not affect this result. -
isAlwaysDown
true
if the sun never rises/sets, but is always below the twilight angle within the next 24 hours.Note that
SunTimes.Parameters.fullCycle()
does not affect this result. -
toString
-