Commit 15:18

javadoc
This commit is contained in:
2026-03-18 15:37:18 +01:00
parent 9752aba641
commit 71250d8f79
2 changed files with 44 additions and 5 deletions

View File

@@ -6,12 +6,23 @@ import ecoparasite.input.RawData;
import java.util.HashSet; import java.util.HashSet;
public class Merlu extends Poisson implements DataParsing { 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 @Override
public HashSet<Poisson> parse(RawData data) { public HashSet<Poisson> parse(RawData data) { //TODO
HashSet<Poisson> fishSet; HashSet<Poisson> fishSet;
fishSet = new HashSet<>(); fishSet = new HashSet<>();

View File

@@ -10,32 +10,60 @@ public class Poisson{
private Double infestation; private Double infestation;
protected HashSet<PartiePoisson> fishParts; protected HashSet<PartiePoisson> 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){ public Poisson(String specie, Double length, Double weight, Double infestation){
this.specie = specie; this.specie = specie;
this.length = length; this.length = length;
this.weight = weight; this.weight = weight;
this.infestation = infestation; this.infestation = infestation;
this.fishParts = null;
} }
/**
* Getter de l'attribut specie
* @return La string de l'attribut specie
*/
public String getSpecie() { public String getSpecie() {
return specie; return specie;
} }
/**
* Getter de l'attribut length
* @return Le Double de l'attribut length
*/
public Double getLength() { public Double getLength() {
return length; return length;
} }
/**
* Getter de l'attribut weight
* @return Le Double de l'attribut weight
*/
public Double getWeight() { public Double getWeight() {
return weight; return weight;
} }
/**
* Getter de l'attribut infestation
* @return Le Double de l'attribut infestation
*/
public Double getInfestation() { public Double getInfestation() {
return infestation; return infestation;
} }
/**
* Permet d'afficher les informations de notre poisson
* @return La string contenant les informations
*/
@Override @Override
public String toString(){ 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());
} }
} }