Class WeatherForecast
java.lang.Object
cz.krystofcejchan.lite_weather_lib.weather_objects.subparts.forecast.WeatherForecast
Weather forecast for today, tomorrow, the day after tomorrow
Data can be separated into hours → 12am, 3am, 6am, 9am, 12pm, 3pm, 6pm, 9pm.
see
Data can be separated into hours → 12am, 3am, 6am, 9am, 12pm, 3pm, 6pm, 9pm.
see
TIME, DAY- Version:
- 17
- Author:
- krystof-cejchan
-
Constructor Summary
ConstructorsConstructorDescriptionWeatherForecast(String location, DAY[] day, TIME... times) WeatherForecast(String location, DAY day, TIME... times) WeatherForecast(String location, TIME[] times, DAY... days) WeatherForecast(String location, TIME time, DAY... days) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidremoves saved forecastsget all possible forecasts for all days and times you provided in the constructorDAY[]getDays()getForecastFor(DAY day, TIME time) returns forecast for specific day and timeTIME[]getTimes()getToday()static voidremovedSavedForecast(ForecastAtHour forecast) removes forecast from paramtoString()
-
Constructor Details
-
WeatherForecast
- Throws:
IOException
-
WeatherForecast
- Throws:
IOException
-
WeatherForecast
- Throws:
IOException
-
WeatherForecast
- Throws:
IOException
-
-
Method Details
-
clearSavedForecasts
public static void clearSavedForecasts()removes saved forecasts -
removedSavedForecast
removes forecast from param- Parameters:
forecast- to be removed
-
getForecastFor
returns forecast for specific day and time- Parameters:
day-DAYfor which you want to know the forecasttime-TIMEfor 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
get all possible forecasts for all days and times you provided in the constructor- Returns:
- a map of
DAYand map ofTIMEandForecastAtHour
-
getToday
- Returns:
- object containing all weather data for today
- Throws:
NoDataFoundForThisDay- if you did not include this day in constructor
-
getTomorrow
- Returns:
- object containing all weather data for tomorrow
- Throws:
NoDataFoundForThisDay- if you did not include this day in constructor
-
getTomorrowAfter
- Returns:
- object containing all weather data for the day after tomorrow
- Throws:
NoDataFoundForThisDay- if you did not include this day in constructor
-
getDays
- Returns:
- DAYs provided in constructor
-
getTimes
- Returns:
- TIMEs provided in constructor
-
getAllSavedForecasts
- Returns:
- all saved forecasts
-
toString
- Overrides:
toStringin classObject- Returns:
- object to string, modified to prevent
NullPointerExceptionif class fields are null
-