Class SolarTime.Builder
- Enclosing class:
- SolarTime
Helper class to construct a new instance of SolarTime
.
- Since:
- 3.35/4.30
- Author:
- Meno Hochschild
-
Method Summary
Modifier and TypeMethodDescriptionatAltitude(int altitude)
Sets the altitude in meters.build()
Finishes the build-process.easternLongitude(int degrees, int minutes, double seconds)
Sets the eastern longitude in degrees, arc minutes and arc seconds.inTimezone(TZID observerZoneID)
Helps to associate any calendar date input with given timezone.northernLatitude(int degrees, int minutes, double seconds)
Sets the northern latitude in degrees, arc minutes and arc seconds.southernLatitude(int degrees, int minutes, double seconds)
Sets the southern latitude in degrees, arc minutes and arc seconds.usingCalculator(String calculator)
Sets the reference to the solar time calculator to be used.usingCalculator(SolarTime.Calculator calculator)
Sets the solar time calculator to be used.westernLongitude(int degrees, int minutes, double seconds)
Sets the western longitude in degrees, arc minutes and arc seconds.
-
Method Details
-
northernLatitude
Sets the northern latitude in degrees, arc minutes and arc seconds.
- Parameters:
degrees
- degrees in range0 <= x <= 90
minutes
- arc minutes in range0 <= x < 60
seconds
- arc seconds in range0.0 <= x < 60.0
- Returns:
- this instance for method chaining
- Throws:
IllegalArgumentException
- if any parameter is out of rangeIllegalStateException
- if the latitude has already been set- See Also:
southernLatitude(int, int, double)
-
southernLatitude
Sets the southern latitude in degrees, arc minutes and arc seconds.
- Parameters:
degrees
- degrees in range0 <= x <= 90
minutes
- arc minutes in range0 <= x < 60
seconds
- arc seconds in range0.0 <= x < 60.0
- Returns:
- this instance for method chaining
- Throws:
IllegalArgumentException
- if any parameter is out of rangeIllegalStateException
- if the latitude has already been set- See Also:
northernLatitude(int, int, double)
-
easternLongitude
Sets the eastern longitude in degrees, arc minutes and arc seconds.
- Parameters:
degrees
- degrees in range0 <= x < 180
minutes
- arc minutes in range0 <= x < 60
seconds
- arc seconds in range0.0 <= x < 60.0
- Returns:
- this instance for method chaining
- Throws:
IllegalArgumentException
- if any parameter is out of rangeIllegalStateException
- if the longitude has already been set- See Also:
westernLongitude(int, int, double)
-
westernLongitude
Sets the western longitude in degrees, arc minutes and arc seconds.
- Parameters:
degrees
- degrees in range0 <= x <= 180
minutes
- arc minutes in range0 <= x < 60
seconds
- arc seconds in range0.0 <= x < 60.0
- Returns:
- this instance for method chaining
- Throws:
IllegalArgumentException
- if any parameter is out of rangeIllegalStateException
- if the longitude has already been set- See Also:
easternLongitude(int, int, double)
-
atAltitude
Sets the altitude in meters.
The altitude is used to model a geodetic correction as well as a refraction correction based on the simple assumption of a standard atmosphere. Users should keep in mind that the local topology with mountains breaking the horizon line and special weather conditions cannot be taken into account. If this method is not called then a default altitude of zero is assumed.
Attention: Users should also apply a calculator which is capable of altitude corrections.
- Parameters:
altitude
- geographical altitude relative to sea level in meters (0 <= x < 11,0000
)- Returns:
- this instance for method chaining
- Throws:
IllegalArgumentException
- if the argument is not finite or out of range- See Also:
usingCalculator(SolarTime.Calculator)
,StdSolarCalculator.CC
,StdSolarCalculator.TIME4J
-
usingCalculator
Sets the reference to the solar time calculator to be used.
- Parameters:
calculator
- name of solar time calculator- Returns:
- this instance for method chaining
- Throws:
IllegalArgumentException
- if the argument is not valid
-
usingCalculator
Sets the solar time calculator to be used.
- Parameters:
calculator
- instance of solar time calculator- Returns:
- this instance for method chaining
- Since:
- 3.36/4.31
-
inTimezone
Helps to associate any calendar date input with given timezone.
If this method is not called then every calendar date input will be interpreted as LMT (=Local Mean Time). The subtile difference between an LMT-date and a zoned date is usually invisible but can be relevant for a few areas near the international date border (for example Kiribati or Samoa). Note that calendar dates need to exist in given timezone otherwise a
ChronoException
will be thrown.- Parameters:
observerZoneID
- zone identifier associated with chosen geographical position- Returns:
- this instance for method chaining
- Since:
- 3.38/4.33
-
build
Finishes the build-process.
- Returns:
- new configured instance of
SolarTime
- Throws:
IllegalStateException
- if either latitude or longitude have not yet been set
-