Package org.openhab.binding.astro.internal.model

Examples of org.openhab.binding.astro.internal.model.Season


   * Returns the seasons of the year of the specified calendar.
   */
  public Season getSeason(Calendar calendar, double latitude) {
    int year = calendar.get(Calendar.YEAR);
    boolean isSouthernHemisphere = latitude < 0.0;
    Season season = currentSeason;
    if (currentYear != year) {
      season = new Season();
      if (!isSouthernHemisphere) {
        season.setSpring(calcEquiSol(0, year));
        season.setSummer(calcEquiSol(1, year));
        season.setAutumn(calcEquiSol(2, year));
        season.setWinter(calcEquiSol(3, year));
      } else {
        season.setSpring(calcEquiSol(2, year));
        season.setSummer(calcEquiSol(3, year));
        season.setAutumn(calcEquiSol(0, year));
        season.setWinter(calcEquiSol(1, year));
      }
      currentSeason = season;
      currentYear = year;
    }

    season.setName(!isSouthernHemisphere ? getCurrentSeasonNameNorthern(calendar) : getCurrentSeasonNameSouthern(calendar));
    return season;
  }
View Full Code Here

TOP

Related Classes of org.openhab.binding.astro.internal.model.Season

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.