java.lang.Object
cz.krystofcejchan.lite_weather_lib.weather_objects.subparts.forecast.WeatherForecast

public class WeatherForecast
extends Object
Weather forecast for today, tomorrow, the day after tomorrow
Data can be separated into hours → 12am, 3am, 6am, 9am, 12pm, 3pm, 6pm, 9pm.
see TIME, DAY
Version:
17
Author:
krystof-cejchan
  • Constructor Details

  • Method Details

    • clearSavedForecasts

      public static void clearSavedForecasts()
      removes saved forecasts
    • removedSavedForecast

      public static void removedSavedForecast​(ForecastAtHour forecast)
      removes forecast from param
      Parameters:
      forecast - to be removed
    • getForecastFor

      public ForecastAtHour getForecastFor​(@NotNull DAY day, @NotNull TIME time) throws NoDataFoundForThisDayAndTime
      returns forecast for specific day and time
      Parameters:
      day - DAY for which you want to know the forecast
      time - TIME for which you want to know the forecast
      Returns:
      ForecastAtHour for provided DAY and TIME
      Throws:
      NoDataFoundForThisDayAndTime - if you did not include day and time when creating constructor
    • getAllForecastForAllDayAndAllTime

      public Map<DAY,​Map<TIME,​ForecastAtHour>> getAllForecastForAllDayAndAllTime()
      get all possible forecasts for all days and times you provided in the constructor
      Returns:
      a map of DAY and map of TIME and ForecastAtHour
    • getToday

      public Today getToday() throws NoDataFoundForThisDay
      Returns:
      object containing all weather data for today
      Throws:
      NoDataFoundForThisDay - if you did not include this day in constructor
    • getTomorrow

      public Tomorrow getTomorrow() throws NoDataFoundForThisDay
      Returns:
      object containing all weather data for tomorrow
      Throws:
      NoDataFoundForThisDay - if you did not include this day in constructor
    • getTomorrowAfter

      public AfterTomorrow getTomorrowAfter() throws NoDataFoundForThisDay
      Returns:
      object containing all weather data for the day after tomorrow
      Throws:
      NoDataFoundForThisDay - if you did not include this day in constructor
    • getDays

      public DAY[] getDays()
      Returns:
      DAYs provided in constructor
    • getTimes

      public TIME[] getTimes()
      Returns:
      TIMEs provided in constructor
    • getLocation

      public String getLocation()
      Returns:
      location provided in the constructor of this class or its parent class
      if you need to get more detailed information, use NearestArea
    • getAllSavedForecasts

      @CheckForNull public List<ForecastAtHour> getAllSavedForecasts()
      Returns:
      all saved forecasts
    • print

      public void print()
      prints current object.toString to the console
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      object to string, modified to prevent NullPointerException if class fields are null