From 6a495edaa052117ec5c1faac46a467e2f5d6cc8c Mon Sep 17 00:00:00 2001 From: Minh VU Date: Fri, 20 Dec 2024 12:26:21 +0100 Subject: [PATCH 1/2] add description in interface --- src/fr/api/Configuration.java | 29 +++++++++++++++++++++-- src/fr/api/Configurator.java | 16 +++++++++++++ src/fr/api/PartType.java | 7 ++++++ src/fr/impl/CompatibilityCheckerImpl.java | 2 -- 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/src/fr/api/Configuration.java b/src/fr/api/Configuration.java index 7a7e221..24dfc40 100644 --- a/src/fr/api/Configuration.java +++ b/src/fr/api/Configuration.java @@ -7,12 +7,37 @@ public interface Configuration { * @return true if there is no compatibility issue between PartType else false */ boolean isValid(); - - + + /* + * @return true if the configuration is valid and done + */ boolean isComplete(); + + /* + * @return the list of the PartType in the configuration + */ Set getSelectedParts(); + + /* + * Select a PartType to add to the configuration + * @param chosenPart : the PartType that we wish to add to the configuration + */ void selectPart(PartType chosenPart); + + /* + * @return the PartType that we chose earlier which has Category we choose + * @param catgeory : Category that we want to know about the PartType can be null + */ PartType getSelectionForCategory(Category category); + + /* + * DeSelect a PartType to delete from the configuration + * @param chosenPart : the PartType that we wish to delete from the configuration + */ void unselectPartType(Category categoryToClear); + + /* + * Remove all PartType from configuation + */ void clear(); } \ No newline at end of file diff --git a/src/fr/api/Configurator.java b/src/fr/api/Configurator.java index cf53845..9ab61e1 100644 --- a/src/fr/api/Configurator.java +++ b/src/fr/api/Configurator.java @@ -1,8 +1,24 @@ package src.fr.api; import java.util.Set; public interface Configurator { + /* + * @return the list of the Category in the configurator + */ Set getCategories(); + + /* + * @return the list of the Category in the configurator + * @param category: category that we want to see all PartType in that category + */ Set getVariants(Category category); + + /* + * @return the configuration + */ Configuration getConfiguration(); + + /* + * @return compabilitychecker + */ CompatibilityChecker getCompatibilityChecker(); } \ No newline at end of file diff --git a/src/fr/api/PartType.java b/src/fr/api/PartType.java index b9fbe1f..e26ef12 100644 --- a/src/fr/api/PartType.java +++ b/src/fr/api/PartType.java @@ -1,5 +1,12 @@ package src.fr.api; public interface PartType { + /* + * @return name of this PartType + */ String getName(); + + /* + * @return the category of this PartType + */ Category getCategory(); } \ No newline at end of file diff --git a/src/fr/impl/CompatibilityCheckerImpl.java b/src/fr/impl/CompatibilityCheckerImpl.java index def029b..58cb09e 100644 --- a/src/fr/impl/CompatibilityCheckerImpl.java +++ b/src/fr/impl/CompatibilityCheckerImpl.java @@ -22,6 +22,4 @@ public class CompatibilityCheckerImpl implements CompatibilityChecker { public Set getRequirements(PartType reference) { return this.compatibilityManager.getRequirements(reference); } - - } From 4880ae8b3ff5260ceda786d6a560c00c99e382ed Mon Sep 17 00:00:00 2001 From: Vu Tuan Minh Date: Fri, 20 Dec 2024 12:17:45 +0000 Subject: [PATCH 2/2] Update Configuration.java --- src/fr/api/Configuration.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fr/api/Configuration.java b/src/fr/api/Configuration.java index 24dfc40..4e76516 100644 --- a/src/fr/api/Configuration.java +++ b/src/fr/api/Configuration.java @@ -31,8 +31,9 @@ public interface Configuration { PartType getSelectionForCategory(Category category); /* - * DeSelect a PartType to delete from the configuration - * @param chosenPart : the PartType that we wish to delete from the configuration + * DeSelect PartType has Catgerory catgoryToClear to delete from the configuration + * @param categoryToClear : the PartType has categoryToClear Category + * that we wish to delete from the configuration */ void unselectPartType(Category categoryToClear);