com.luckycatlabs.sunrisesunset.calculator
Class SolarEventCalculator
- java.lang.Object
-
- com.luckycatlabs.sunrisesunset.calculator.SolarEventCalculator
-
public class SolarEventCalculator extends java.lang.ObjectParent class of the Sunrise and Sunset calculator classes.
-
-
Constructor Summary
Constructors Constructor and Description SolarEventCalculator(Location location, java.lang.String timeZoneIdentifier)Constructs a newSolarEventCalculatorusing the given parameters.SolarEventCalculator(Location location, java.util.TimeZone timeZone)Constructs a newSolarEventCalculatorusing the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.CalendarcomputeSunriseCalendar(Zenith solarZenith, java.util.Calendar date)Computes the sunrise time for the given zenith at the given date.java.lang.StringcomputeSunriseTime(Zenith solarZenith, java.util.Calendar date)Computes the sunrise time for the given zenith at the given date.java.util.CalendarcomputeSunsetCalendar(Zenith solarZenith, java.util.Calendar date)Computes the sunset time for the given zenith at the given date.java.lang.StringcomputeSunsetTime(Zenith solarZenith, java.util.Calendar date)Computes the sunset time for the given zenith at the given date.
-
-
-
Constructor Detail
-
SolarEventCalculator
public SolarEventCalculator(Location location, java.lang.String timeZoneIdentifier)
Constructs a newSolarEventCalculatorusing the given parameters.- Parameters:
location-Locationof 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, java.util.TimeZone timeZone)
Constructs a newSolarEventCalculatorusing the given parameters.- Parameters:
location-Locationof the place where the solar event should be calculated from.timeZone- timezone of the location parameter.
-
-
Method Detail
-
computeSunriseTime
public java.lang.String computeSunriseTime(Zenith solarZenith, java.util.Calendar date)
Computes the sunrise time for the given zenith at the given date.- Parameters:
solarZenith-Zenithenum corresponding to the type of sunrise to compute.date-Calendarobject 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 java.util.Calendar computeSunriseCalendar(Zenith solarZenith, java.util.Calendar date)
Computes the sunrise time for the given zenith at the given date.- Parameters:
solarZenith-Zenithenum corresponding to the type of sunrise to compute.date-Calendarobject representing the date to compute the sunrise for.- Returns:
- the sunrise time as a calendar or null for no sunrise
-
computeSunsetTime
public java.lang.String computeSunsetTime(Zenith solarZenith, java.util.Calendar date)
Computes the sunset time for the given zenith at the given date.- Parameters:
solarZenith-Zenithenum corresponding to the type of sunset to compute.date-Calendarobject 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 java.util.Calendar computeSunsetCalendar(Zenith solarZenith, java.util.Calendar date)
Computes the sunset time for the given zenith at the given date.- Parameters:
solarZenith-Zenithenum corresponding to the type of sunset to compute.date-Calendarobject representing the date to compute the sunset for.- Returns:
- the sunset time as a Calendar or null for no sunset.
-
-
DMelt 3.0 © DataMelt by jWork.ORG