fix: small fix to uml

This commit is contained in:
Nemo D'ACREMONT 2024-12-20 18:40:40 +01:00
parent c205409347
commit bfacaf514a
3 changed files with 8 additions and 8 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -16,8 +16,8 @@ package eirb.pg203.weather {
}
class WeatherDataCache {
+ private HashMap<String,WeatherDataCache.CacheValue> {final} cache
+ private long {static} {final} cacheTTL
- private HashMap<String,WeatherDataCache.CacheValue> cache
- private long cacheTTL
+ boolean has(String cityName, int day)
+ boolean needsUpdate(String cityName, int day)
+ void set(String cityName, int day, WeatherData value, Instant timestamp)
@ -26,7 +26,7 @@ package eirb.pg203.weather {
}
abstract class WeatherCachedAPI implements WeatherDataAPI {
~ WeatherDataCache {final} cache
- private WeatherDataCache cache
+ JSONArray toJSON()
+ void loadCache(JSONArray data)
+ void loadCacheFromFile(String path)
@ -35,13 +35,13 @@ package eirb.pg203.weather {
}
Class OpenMeteo extends WeatherCachedAPI {
- String {final} forecastBaseUrl
- String {final} daylyQuery
- String forecastBaseUrl
- String daylyQuery
~ JSONFetcher JSONFetcher
~ Clock clock
- JSONObject fetchWeather(int days, City city)
- Condition {static} getConditionFromCode(int WMOCode)
- WeatherData getWeatherDataFromForecast(JSONObject response, int day, String city)
- ArrayList<WeatherData> getWeatherDataFromForecast(JSONObject response, int day, String city)
}
Class OpenWeatherMap extends WeatherCachedAPI {

View File

@ -60,7 +60,7 @@ public class WeatherDataCache {
}
private final HashMap<String, CacheValue> cache = new HashMap<>();
private static final long cacheTTL = 3600; // Cache data Time To Live in sec
private final long cacheTTL = 3600; // Cache data Time To Live in sec
private String makeKey(String cityName, int day) {
return String.format(Locale.ENGLISH, "%s%d", cityName, day);