SolarEventCalculator
com.luckycatlabs.sunrisesunset.calculator

Class SolarEventCalculator



  • public class SolarEventCalculatorextends Object
    Parent class of the Sunrise and Sunset calculator classes.
    • Constructor Detail

      • SolarEventCalculator

        public SolarEventCalculator(Location location,                    String timeZoneIdentifier)
        Constructs a new SolarEventCalculator using the given parameters.
        Parameters:
        location - Location of the place where the solar event should be calculated from.
        timeZoneIdentifier - time zone identifier of the timezone of the location parameter. For example, "America/New_York".
      • SolarEventCalculator

        public SolarEventCalculator(Location location,                    TimeZone timeZone)
        Constructs a new SolarEventCalculator using the given parameters.
        Parameters:
        location - Location of the place where the solar event should be calculated from.
        timeZone - timezone of the location parameter.
    • Method Detail

      • computeSunriseTime

        public String computeSunriseTime(Zenith solarZenith,                        Calendar date)
        Computes the sunrise time for the given zenith at the given date.
        Parameters:
        solarZenith - Zenith enum corresponding to the type of sunrise to compute.
        date - Calendar object representing the date to compute the sunrise for.
        Returns:
        the sunrise time, in HH:MM format (24-hour clock), 00:00 if the sun does not rise on the given date.
      • computeSunriseCalendar

        public Calendar computeSunriseCalendar(Zenith solarZenith,                              Calendar date)
        Computes the sunrise time for the given zenith at the given date.
        Parameters:
        solarZenith - Zenith enum corresponding to the type of sunrise to compute.
        date - Calendar object representing the date to compute the sunrise for.
        Returns:
        the sunrise time as a calendar or null for no sunrise
      • computeSunsetTime

        public String computeSunsetTime(Zenith solarZenith,                       Calendar date)
        Computes the sunset time for the given zenith at the given date.
        Parameters:
        solarZenith - Zenith enum corresponding to the type of sunset to compute.
        date - Calendar object representing the date to compute the sunset for.
        Returns:
        the sunset time, in HH:MM format (24-hour clock), 00:00 if the sun does not set on the given date.
      • computeSunsetCalendar

        public Calendar computeSunsetCalendar(Zenith solarZenith,                             Calendar date)
        Computes the sunset time for the given zenith at the given date.
        Parameters:
        solarZenith - Zenith enum corresponding to the type of sunset to compute.
        date - Calendar object representing the date to compute the sunset for.
        Returns:
        the sunset time as a Calendar or null for no sunset.

SCaVis 2.0 © jWork.ORG