All Known Implementing Classes:
AfterTomorrow, Today, Tomorrow

public interface IForecastDayTimesAndDays
inteface impletended in Today Tomorrow and AfterTomorrow
Version:
17
Author:
krystof-cejchan
  • Method Details

    • getMatchingObjectFrom

      @NotNull static ForecastAtHour getMatchingObjectFrom​(DAY day, TIME time) throws NoDataFoundForThisDayAndTime, CannotSearchForAll
      returns forecast for specific day and hour
      Parameters:
      day - for which you need the forecast
      time - for which you need the forecast
      Returns:
      Forecast data for provided DAY and TIME; if not found NoDataFoundForThisDayAndTime exception is thrown
      Throws:
      NoDataFoundForThisDayAndTime - if no forecast was included for this TIME and DAY; you need to use TIME.ALL with DAY.ALL if you want to prevent this or include TIME and DAY you want to know the forecast for in the constructor when creating forecast object or its subclasses
      CannotSearchForAll - DAY or TIME is set to ALL; you can get single object of ForecastAtHour only for certain DAY and TIME
    • clearSavedForecasts

      static void clearSavedForecasts()
    • removedSavedForecast

      static void removedSavedForecast​(ForecastAtHour forecast)
    • getDay

      DAY getDay()
      Returns:
      day which implementing class represents
    • getTime

      TIME[] getTime()
      Returns:
      time provided by user when calling this class or superclass
    • getForecastByTime

      ForecastAtHour getForecastByTime​(TIME time) throws NoDataFoundForThisDayAndTime
      implemented by Today, Tomorrow and AfterTomorrow, therefor no day is needed
      Parameters:
      time - for weather data
      Returns:
      ForecastAtHour object containing all data for specific day and time
      Throws:
      NoDataFoundForThisDayAndTime
    • addHour

      default void addHour​(ForecastAtHour forecast)
      add Forecast object
      Parameters:
      forecast - ForecastAtHour object containing weather data for specific day and time(hour)