Class SolarTime.Sunshine
- Enclosing class:
- SolarTime
Collects various data around sunrise and sunset.
- Since:
- 3.34/4.29
- Author:
- Meno Hochschild
-
Method Summary
Modifier and TypeMethodDescriptionendLocal()
Obtains the local timestamp of sunset if it exists.endUTC()
Obtains the moment of sunset if it exists.boolean
isAbsent()
Checks if any sunshine is unavailable (polar night).boolean
Is there any sunshine at given moment?boolean
isPresent(PlainTimestamp tsp)
Is there any sunshine at given local timestamp?int
length()
Obtains the length of sunshine in seconds.Obtains the local timestamp of sunrise if it exists.startUTC()
Obtains the moment of sunrise if it exists.toString()
For debugging purposes.
-
Method Details
-
startUTC
Obtains the moment of sunrise if it exists.
Note: If there is no sunrise but the sun is already above the horizon at the start of day then this method yields the start of day.
- Returns:
- moment of sunrise
- Throws:
IllegalStateException
- in case of absent sunshine (polar night)- See Also:
isAbsent()
-
endUTC
Obtains the moment of sunset if it exists.
Note: If there is no sunset but the sun is still above the horizon at the end of day then this method yields the end of day.
- Returns:
- moment of sunset (exclusive)
- Throws:
IllegalStateException
- in case of absent sunshine (polar night)- See Also:
isAbsent()
-
startLocal
Obtains the local timestamp of sunrise if it exists.
Note: If there is no sunrise but the sun is already above the horizon at the start of day then this method yields the start of day.
- Returns:
- local timestamp of sunrise
- Throws:
IllegalStateException
- in case of absent sunshine (polar night)- See Also:
isAbsent()
-
endLocal
Obtains the local timestamp of sunset if it exists.
Note: If there is no sunset but the sun is still above the horizon at the end of day then this method yields the end of day.
- Returns:
- local timestamp of sunset (exclusive)
- Throws:
IllegalStateException
- in case of absent sunshine (polar night)- See Also:
isAbsent()
-
isPresent
Is there any sunshine at given moment?
- Parameters:
moment
- the instant to be queried- Returns:
- boolean
-
isPresent
Is there any sunshine at given local timestamp?
- Parameters:
tsp
- the local timestamp to be queried- Returns:
- boolean
-
isAbsent
public boolean isAbsent()Checks if any sunshine is unavailable (polar night).
- Returns:
true
if this instance corresponds to a polar night elsefalse
-
length
public int length()Obtains the length of sunshine in seconds.
- Returns:
- physical length of sunshine in seconds (without leap seconds)
- See Also:
TimeUnit.SECONDS
-
toString
For debugging purposes.
-