Interface IForecastDayTimesAndDays
- All Known Implementing Classes:
AfterTomorrow,Today,Tomorrow
public interface IForecastDayTimesAndDays
- Author:
- krystof-cejchan
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddHour(ForecastAtHour forecast) add Forecast objectstatic voidgetDay()getForecastByTime(TIME time) implemented by Today, Tomorrow and AfterTomorrow, therefor no day is neededstatic ForecastAtHourgetMatchingObjectFrom(DAY day, TIME time) returns forecast for specific day and hourTIME[]getTime()static voidremovedSavedForecast(ForecastAtHour forecast)
-
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 forecasttime- for which you need the forecast- Returns:
- Forecast data for provided
DAYandTIME; if not foundNoDataFoundForThisDayAndTimeexception is thrown - Throws:
NoDataFoundForThisDayAndTime- if no forecast was included for thisTIMEandDAY; you need to use TIME.ALL with DAY.ALL if you want to prevent this or includeTIMEandDAYyou want to know the forecast for in the constructor when creating forecast object or its subclassesCannotSearchForAll-DAYorTIMEis set to ALL; you can get single object ofForecastAtHouronly for certain DAY and TIME
-
clearSavedForecasts
static void clearSavedForecasts() -
removedSavedForecast
-
getDay
DAY getDay()- Returns:
- day which implementing class represents
-
getTime
TIME[] getTime()- Returns:
- time provided by user when calling this class or superclass
-
getForecastByTime
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
add Forecast object- Parameters:
forecast-ForecastAtHourobject containing weather data for specific day and time(hour)
-