From f5358ae69c42c7376481ad12e3cb4be7931ddbe7 Mon Sep 17 00:00:00 2001 From: Martin Eyben Date: Wed, 18 Dec 2024 21:12:05 +0100 Subject: [PATCH] feat(uml): add uml source --- diagram_class.puml | 1 + 1 file changed, 1 insertion(+) create mode 100644 diagram_class.puml diff --git a/diagram_class.puml b/diagram_class.puml new file mode 100644 index 0000000..910a3fc --- /dev/null +++ b/diagram_class.puml @@ -0,0 +1 @@ +@startuml title Weather App note "Getters, setters and constructors are not displayed" as N package eirb.pg203 { Interface WeatherDataAPI { + WeatherData getTemperature(int day, String city) + WeatherData getTemperature(int day, int hour, String city) + WeatherData getTemperatures(int days, String city) + String getAPIName() } Interface WeatherDisplay { + void display(int days, String city) + void addAPI(WeatherDataAPI w) } Exception exceptions.WeatherFeatchingException { } Exception exceptions.WeatherFeatchingExceptionApi extends exceptions.WeatherFeatchingException{ } Exception exceptions.WeatherFeatchingExceptionCityCoords extends exceptions.WeatherFeatchingException{ } Class utils.Coords { - float lat - float lon } Class utils.JSONFetcher { + fetch(URL url) - private {static} fetchString(URL url) } Class City { - String cityName - utils.Coords cityCoords ~ JSONFetcher JSONFetcher - private Coords getCoordsFromName(String cityName) + public String toString() } Class WeatherData { - City city - Instant date - float temp - Condition condition - float windSpeed - float windDirectionAngle - WindDirection windDirection + String toString() } Class WeatherDisplayBasic implements WeatherDisplay { - ArrayList apis - double getColumnSize() - void displayHeader(int days, double sourceColumnSize, double dayColumnSize) - void displayWeatherDatas(String apiName, ArrayList weatherDatas, String startColumnSize, double sourceColumnSize, double dayColumnSize) - void displaySeparatorLine(int days, double sourceColumnSize, double dayColumnSize) - void displayAllWeatherDatas() } Class OpenMeteo implements WeatherDataAPI { - String {final} forecastBaseUrl - String {final} daylyQuery ~ JSONFetcher JSONFetcher ~ Clock clock - JSONObject fetchWeather(int days, City city) - Condition {static} getConditionFromCode(int WMOCode) - WeatherData getWeatherDataFromForecast(JSONObject response, int day, String city) } Class OpenWeatherMap implements WeatherDataAPI { - String {static} forecastBaseUrl - String APIKey ~ Clock clock ~ JSONFetcher JSONFetcher - WeatherData getWeatherDataFromForecast(JSONObject response, int day, String city) - JSONObject fetchWeather(City city) } Class WeatherAPI implements WeatherDataAPI { - String APIKey - String {static} forecastBaseUrl ~ JSONFetcher JSONFetcher - JSONObject fetchWeather(int days, String city) - WeatherData.Condition {static} getConditionFromString(String str) - WeatherData {static} getWeatherDataFromForecast(JSONObject response, int day, String city) } } Exception Exception Exception <|-- WeatherFeatchingException @enduml \ No newline at end of file