195 lines
6.1 KiB
Plaintext
195 lines
6.1 KiB
Plaintext
@startuml
|
|
skinparam classAttributeIconSize 0
|
|
enum BoatRampStatus<Model> {
|
|
OPEN
|
|
CLOSED
|
|
UNKNOWN
|
|
|
|
+toString(): String
|
|
+_fromString(status: String): BoatRampStatus
|
|
}
|
|
|
|
skinparam classAttributeIconSize 0
|
|
class BoatRampData<Model> {
|
|
-rampNumber: Integer
|
|
-name: String
|
|
-status: BoatRampStatus
|
|
-openTimes: ZonedDateTime
|
|
-address: String
|
|
-operator: String
|
|
-lastUpdated: LocalDate
|
|
-CACHE_FILE_NAME: String
|
|
|
|
+<<constructor>> BoatRampData(Integer: rampNumber, name: String, status: BoatRampStatus, openTimes, address: String, operator: String, lastUpdated: LocalDate)
|
|
+_loadBoatRampData(): ArrayList<BoatRampData>
|
|
+saveBoatRampData()
|
|
+getRampNumber(): Integer
|
|
+setRampNumber(Integer rampNumber)
|
|
+getName(): String
|
|
+setName(newName: String)
|
|
+getStatus(): BoatRampStatus
|
|
+setStatus(newStatus: BoatRampStatus)
|
|
+getOpenTimes(): ZonedDateTime
|
|
+setOpenTimes(time: ZonedDateTime)
|
|
+getAddress(): String
|
|
+setAddress(newAddress: String)
|
|
+getOperator(): String
|
|
+setOperator(newOperator: String)
|
|
+getLastUpdated(): LocalDate
|
|
+setLastUpdated(newLastUpdatedTime: LocalDate)
|
|
-_fromJsonStream(in: InputStream): ArrayList<BoatRampData>
|
|
+_fetchData(): ArrayList<BoatRampData>
|
|
+_loadCachedData(context: Context): ArrayList<BoatRampData>
|
|
+_wipeCache(context: Context)
|
|
+toJson(): JSONObject
|
|
+_fromJson(json: JSONObject): BoatRampData
|
|
+_saveData(context: Context, rampData: ArrayList<BoatRampData>)
|
|
}
|
|
|
|
skinparam classAttributeIconSize 0
|
|
class BoatRampActivity<Controller> {
|
|
#onCreate(savedInstanceState: Bundle)
|
|
}
|
|
|
|
skinparam classAttributeIconSize 0
|
|
class MainRampMenuActivity<Controller> {
|
|
-executorService: ExecutorService
|
|
|
|
#onCreate(savedInstanceState: Bundle)
|
|
-launchBoatRampActivity(rampData: BoatRampData)
|
|
}
|
|
|
|
skinparam classAttributeIconSize 0
|
|
class WaterLevelData<Model> {
|
|
-date: Date
|
|
-waterLevel: double
|
|
-surfaceArea: double
|
|
-reservoirStorage: int
|
|
-conservationStorage: int
|
|
-percentFull: double
|
|
-conservationCapacity: int
|
|
-deadPoolCapacity: int
|
|
-boolean: isCurrent
|
|
|
|
+<<constructor>>WaterLevelData(date: Date, level: double, isCurrent: boolean)
|
|
+getDate(): String
|
|
+setDate(newDate: Date)
|
|
+getWaterLevel(): double
|
|
+setWaterLevel(newLevel: double)
|
|
+getSurfaceArea(): double
|
|
+setSurfaceArea(newSurfaceArea: double)
|
|
+getReservoirStorage(): int
|
|
+setReservoirStorage(newReservoirStorage: int)
|
|
+getConservationStorage(): int
|
|
+setConservationStorage(newConservationStorage: int)
|
|
+getPercentFull(): double
|
|
+setPercentFull(newPercentFull: double)
|
|
+getConservationCapacity(): int
|
|
+setConservationCapacity(newConservationCapacity: int)
|
|
+getDeadPoolCapacity(): int
|
|
+setDeadPoolCapacity(newDeadPoolCapacity: int)
|
|
+isCurrent(): boolean
|
|
+setCurrent(isCurrent: boolean)
|
|
+toString(): String
|
|
+_getJsonResponseFromApi(): String
|
|
+__loadWaterLevelData(jsonResponse: String): WaterLevelData
|
|
+saveWaterLevelData(context: Context)
|
|
+_loadSavedWaterLevelData(context: Context): WaterLevelData
|
|
+_clearCache(context: Context)
|
|
+_forceDataFetch(context: Context)
|
|
}
|
|
|
|
skinparam classAttributeIconSize 0
|
|
class WaterLevelActivity<Controller> {
|
|
#onCreate(savedInstanceState: Bundle)
|
|
}
|
|
|
|
skinparam classAttributeIconSize 0
|
|
class MainActivity<Controller> {
|
|
#onCreate(savedInstanceState: Bundle)
|
|
-openSettingsActivity()
|
|
-openWeatherActivity()
|
|
-openWaterLevelActivity()
|
|
-openMainRampMenuActivity()
|
|
}
|
|
|
|
skinparam classAttributeIconSize 0
|
|
class SettingsActivity<Controller> {
|
|
executorService: ExecutorService
|
|
#onCreate(savedInstanceState: Bundle)
|
|
}
|
|
|
|
skinparam classAttributeIconSize 0
|
|
class WeatherActivity<Controller> {
|
|
-weatherDescription: TextView
|
|
-temperature: TextView
|
|
-windDirection: TextView
|
|
-windSpeed: TextView
|
|
-windGust: TextView
|
|
-chancePrecipitation: TextView
|
|
-amountPrecipitation: TextView
|
|
-executorService: ExecutorService
|
|
#onCreate(savedInstanceState: Bundle)
|
|
-fetchWeatherData()
|
|
-onDestroy()
|
|
-updateUIWithWeatherData(weatherData: WeatherData)
|
|
}
|
|
|
|
skinparam classAttributeIconSize 0
|
|
class WeatherData<Model> {
|
|
-weatherDescription: String
|
|
-tempHigh: int
|
|
-tempLow: int
|
|
-windSpeed: String
|
|
-gustSpeed: double
|
|
-windDirection: String
|
|
-chancePrecipitation: int
|
|
-amountPrecipitation: double
|
|
-_CACHE_FILE_NAME: String
|
|
|
|
+<<constructor>> WeatherData(weatherDescription: String, tempHigh: int, tempLow: int, windSpeed: String, gustSpeed: double, windDirection: String, chancePrecipitation: int, amountPrecipitation: double):
|
|
+loadWeatherData(): WeatherData
|
|
+saveWeatherData()
|
|
-fetchHourlyWeatherData(url: String, weatherData: WeatherData)
|
|
-fetchGeneralWeatherData(url: String, weatherData: WeatherData)
|
|
-setupConnection(connection: HttpURLConnection)
|
|
-readStream(in: InputStream): String
|
|
-getMaxTemp(values: JSONArray): int
|
|
-getMinTemp(values: JSONArray): int
|
|
-sumPrecipitation(values: JSONArray, count: int): double
|
|
-convertToFahrenheit(celsius: int): int
|
|
-convertKmhToMph(kmh: double) double
|
|
-convertMmToInches(mm: double) double
|
|
+saveWeatherData()
|
|
+toString(): String
|
|
+getWeatherDescription(): String
|
|
+setWeatherDescription(weatherDescription: String)
|
|
+getTempHigh(): int
|
|
+setTempHigh(tempHigh: int)
|
|
+getTempLow(): int
|
|
+setTempLow(tempLow: int)
|
|
+getWindSpeed(): String
|
|
+setWindSpeed(windSpeed: String)
|
|
+getWindGust(): double
|
|
+setWindGust(windGust: double)
|
|
+getWindDirection(): String
|
|
+setWindDirection(windDirection: String):
|
|
+getChancePrecipitation(): int
|
|
+setChancePrecipitation(chancePrecipitation: int)
|
|
+getAmountPrecipitation(): double
|
|
+setAmountPrecipitation(amountPrecipitation: double)
|
|
+_wipeCache(context: Context)
|
|
}
|
|
|
|
SettingsActivity <.u. MainActivity
|
|
WeatherActivity ..> WeatherData
|
|
WeatherActivity <.u. MainActivity
|
|
BoatRampActivity ..> BoatRampData
|
|
MainRampMenuActivity o-- BoatRampData
|
|
MainRampMenuActivity <.u. MainActivity
|
|
MainRampMenuActivity ..> BoatRampActivity
|
|
WaterLevelActivity ..> WaterLevelData
|
|
WaterLevelActivity <.u. MainActivity
|
|
BoatRampData o-- BoatRampStatus
|
|
@enduml
|