From 71250d8f796eb4e12cc2860b44c022ebb760000c Mon Sep 17 00:00:00 2001 From: Lycano Date: Wed, 18 Mar 2026 15:37:18 +0100 Subject: [PATCH] Commit 15:18 javadoc --- src/ecoparasite/poisson/Merlu.java | 17 ++++++++++++--- src/ecoparasite/poisson/Poisson.java | 32 ++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/ecoparasite/poisson/Merlu.java b/src/ecoparasite/poisson/Merlu.java index e1fec75..941bb0a 100644 --- a/src/ecoparasite/poisson/Merlu.java +++ b/src/ecoparasite/poisson/Merlu.java @@ -6,12 +6,23 @@ import ecoparasite.input.RawData; import java.util.HashSet; public class Merlu extends Poisson implements DataParsing { - public Merlu(String species, Double length, Double infestation) { - super(species, length, null, infestation); + + /** + * Construteur d'un merlu + * @param length Un Wrapper Double representant la longueur/taille du poisson + * @param infestation Un Wrapper Double representant le taux de parasite du poisson + */ + public Merlu(Double length, Double infestation) { + super("Merlu", length, null, infestation); } + /** + * Implémentation de la fonction parse de Dataparsing + * @param data + * @return tableau des poissons + */ @Override - public HashSet parse(RawData data) { + public HashSet parse(RawData data) { //TODO HashSet fishSet; fishSet = new HashSet<>(); diff --git a/src/ecoparasite/poisson/Poisson.java b/src/ecoparasite/poisson/Poisson.java index 3fbc49f..92815b2 100644 --- a/src/ecoparasite/poisson/Poisson.java +++ b/src/ecoparasite/poisson/Poisson.java @@ -10,32 +10,60 @@ public class Poisson{ private Double infestation; protected HashSet fishParts; + /** + * Constructeur de l'objet Poisson + * @param specie Une String representant l'espece du poisson + * @param length Un Wrapper Double representant la longueur/taille du poisson + * @param weight Un Wrapper Double representant le poids du poisson + * @param infestation Un Wrapper Double representant le taux de parasite du poisson + */ public Poisson(String specie, Double length, Double weight, Double infestation){ this.specie = specie; this.length = length; this.weight = weight; this.infestation = infestation; + this.fishParts = null; } - + /** + * Getter de l'attribut specie + * @return La string de l'attribut specie + */ public String getSpecie() { return specie; } + /** + * Getter de l'attribut length + * @return Le Double de l'attribut length + */ public Double getLength() { return length; } + /** + * Getter de l'attribut weight + * @return Le Double de l'attribut weight + */ public Double getWeight() { return weight; } + /** + * Getter de l'attribut infestation + * @return Le Double de l'attribut infestation + */ public Double getInfestation() { return infestation; } + /** + * Permet d'afficher les informations de notre poisson + * @return La string contenant les informations + */ @Override public String toString(){ - return ""; + String result = "[ %5s : %4d mm, %4d g, %4d taux d'infestation ]"; + return String.format(result, this.getClass().getSimpleName(), this.getLength(), this.getWeight(), this.getInfestation()); } }