Package com.luckycatlabs.sunrisesunset

Examples of com.luckycatlabs.sunrisesunset.SunriseSunsetCalculator


    }

    private void computeSunriseSunset(final LocationFacet locationFacet, final City city, final VisitedCity mdFacet) {
        Location location = new Location(String.valueOf(locationFacet.latitude), String.valueOf(locationFacet.longitude));
        final TimeZone timeZone = TimeZone.getTimeZone(city.geo_timezone);
        SunriseSunsetCalculator calc = new SunriseSunsetCalculator(location, timeZone);
        Calendar c = Calendar.getInstance(timeZone);
        c.setTimeInMillis(locationFacet.start);
        Calendar sunrise = calc.getOfficialSunriseCalendarForDate(c);
        Calendar sunset = calc.getOfficialSunsetCalendarForDate(c);
        if (sunrise==null||sunset==null)
            return;
        if (sunrise.getTimeInMillis() > sunset.getTimeInMillis()) {
            Calendar sr = sunrise;
            Calendar ss = sunset;
View Full Code Here


      DayMetadata dayMetadata) {
    SolarInfoModel solarInfo = new SolarInfoModel();
    Location location = new Location(String.valueOf(latitude),
        String.valueOf(longitude));
    TimeZone timeZone = metadataService.getTimeZone(latitude, longitude);
    SunriseSunsetCalculator calc = new SunriseSunsetCalculator(location,
        timeZone);
    Calendar c = dayMetadata.getStartCalendar();
    Calendar sunrise = calc.getOfficialSunriseCalendarForDate(c);
    Calendar sunset = calc.getOfficialSunsetCalendarForDate(c);
    if (sunrise.getTimeInMillis() > sunset.getTimeInMillis()) {
      Calendar sr = sunrise;
      Calendar ss = sunset;
      sunset = sr;
      sunrise = ss;
View Full Code Here

TOP

Related Classes of com.luckycatlabs.sunrisesunset.SunriseSunsetCalculator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.