From da7a31f512327dd110db58074c27446d840c51b4 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Sun, 30 Oct 2022 09:37:27 +0100 Subject: [PATCH] java doc and readme update --- README.md | 3 +++ .../gartenverwaltung/plantList/PlantListModel.java | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b7f091..8e56120 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,6 @@ These branches are for bugfixes. These branches are for javadoc and project documentation (such as the readme, class diagrams etc.). + +## User Manual +- Search Plant List: if first Char is '#': only exact match in ID. diff --git a/src/main/java/ch/zhaw/gartenverwaltung/plantList/PlantListModel.java b/src/main/java/ch/zhaw/gartenverwaltung/plantList/PlantListModel.java index d839a3c..b4f2a21 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/plantList/PlantListModel.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/plantList/PlantListModel.java @@ -99,7 +99,14 @@ public class PlantListModel { return plantList; } - + /** + * + * @param zone selected hardiness zone + * @param searchString the string to search plant List, set '#' as first char the search by id. + * @return List of plants found in Plant List which contain the search String in the name or description + * @throws HardinessZoneNotSetException If no {@link HardinessZone} was specified + * @throws IOException If the database cannot be accessed + */ public List getFilteredPlantListByString(HardinessZone zone, String searchString) throws HardinessZoneNotSetException, IOException { if(searchString.charAt(0) == '#') { try { @@ -111,6 +118,4 @@ public class PlantListModel { return getFilteredPlantList(zone, plant -> plant.name().contains(searchString) || plant.description().contains(searchString)); } } - - }