How niloofar-amirzadeh/thegreenestplanthotel works
The Greenest Plant Hotel is a small Swing desktop app for looking up daily watering needs. A user enters a plant name; the program checks a predefined set of plants, asks the matching plant for its liquid amount and type, and displays the result. The plant subclasses each implement their own calculation, while shared plant data and a liquid-type enum provide common structure. The excerpts show this main workflow and the domain relationships; no separate persistence or external service is documented.
Main entry points: Main.java Application flow · Plant.java Plant base · Cactus.java Cactus · LiquidType.java Liquid types
Components 11
User interaction
- Application flow
src/TheGreenestPlantHotel/Main.java
Plant domain
- Plant base
src/TheGreenestPlantHotel/Plant.java - Waterable contract
src/TheGreenestPlantHotel/Waterable.java - Cactus
src/TheGreenestPlantHotel/Cactus.java - Palm
src/TheGreenestPlantHotel/Palm.java - Carnivorous plant
src/TheGreenestPlantHotel/CarnivorousPlant.java - Liquid types
src/TheGreenestPlantHotel/LiquidType.java
Shared support
- Unit converter
src/TheGreenestPlantHotel/UnitConverter.java - App constants
src/TheGreenestPlantHotel/AppConstants.java
Other components
- User
- Swing dialogs
Connections 17
- User → Application flow: enters name
src/TheGreenestPlantHotel/Main.java - Application flow → Swing dialogs: prompts and displays
src/TheGreenestPlantHotel/Main.java - Application flow → App constants: reads settings
src/TheGreenestPlantHotel/Main.java - Application flow → Cactus: creates plant
src/TheGreenestPlantHotel/Main.java - Application flow → Palm: creates plant
src/TheGreenestPlantHotel/Main.java - Application flow → Carnivorous plant: creates plant
src/TheGreenestPlantHotel/Main.java - Application flow → Unit converter: converts height
src/TheGreenestPlantHotel/Main.java - Application flow → Plant base: queries match
src/TheGreenestPlantHotel/Main.java - Cactus → Plant base: extends
src/TheGreenestPlantHotel/Cactus.java - Palm → Plant base: extends
src/TheGreenestPlantHotel/Palm.java - Carnivorous plant → Plant base: extends
src/TheGreenestPlantHotel/CarnivorousPlant.java - Plant base → Waterable contract: implements
src/TheGreenestPlantHotel/Plant.java - Plant base → Liquid types: returns type
src/TheGreenestPlantHotel/Plant.java - Cactus → Liquid types: returns type
src/TheGreenestPlantHotel/Cactus.java - Palm → Liquid types: returns type
src/TheGreenestPlantHotel/Palm.java - Carnivorous plant → Liquid types: returns type
src/TheGreenestPlantHotel/CarnivorousPlant.java - Cactus → Unit converter: converts amount
src/TheGreenestPlantHotel/Cactus.java