From 98f4bb6e1a63dab5d3e880e43895a2c44da45266 Mon Sep 17 00:00:00 2001 From: SIMAILA Djalim Date: Wed, 14 Dec 2022 14:58:08 +0100 Subject: [PATCH] finished documentation for class Pair --- src/main/java/fr/packageviewer/Pair.java | 36 ++++++++++++++++++------ 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/main/java/fr/packageviewer/Pair.java b/src/main/java/fr/packageviewer/Pair.java index 625e133..75db71f 100644 --- a/src/main/java/fr/packageviewer/Pair.java +++ b/src/main/java/fr/packageviewer/Pair.java @@ -3,52 +3,72 @@ package fr.packageviewer; /** * The Pair class stores two objects of distinct type * - * @author C.Marla, R.Thomas, S.Djalim + * @author R.Thomas * @version 1.0 */ -public class Pair { +public class Pair { private K first; private V second; + /** - * + * Empty Constructor for the Pair class */ public Pair() { } /** + * Main Constructor for the Pair class * - * @param first - * @param second + * @param first, the first object to be stored + * @param second the second object to be stored */ public Pair(K first, V second) { this.first = first; this.second = second; } + /** + * Getter for the attribute first * - * @return + * @return the object stored in the attribute first */ public K getFirst() { return first; } + /** + * Setter for the attribute first + * + * @param first Store the given object in the attribute first + */ public void setFirst(K first) { this.first = first; } - + /** + * Getter for the attribute second * - * @return + * @return the object stored in the attribute second */ public V getSecond() { return second; } + /** + * Setter for the attribute second + * + * @param second Store the given object in the attribute second + */ public void setSecond(V second) { this.second = second; } + /** + * Returns a string reprensentation of the pair + * + * @return String, string reprensentation of the pair + */ @Override public String toString() { return "Pair{key=%s,value=%s}".formatted(first, second);