4 Commits

Author SHA1 Message Date
0ba46cc9cc Merge pull request '18.03.26' (#2) from 18.03.26 into master
Reviewed-on: #2
2026-03-18 15:03:39 +00:00
f79e2f7d92 Supprimer src/ecoparasite/input/RawData.java 2026-03-18 15:03:31 +00:00
71250d8f79 Commit 15:18
javadoc
2026-03-18 15:37:18 +01:00
9752aba641 Commit 15:18
Poisson mostly okay, merlu and mackerel here and data parsing existing
2026-03-18 15:19:10 +01:00
6 changed files with 149 additions and 0 deletions

11
Projet.iml Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -0,0 +1,10 @@
package ecoparasite.input;
import ecoparasite.poisson.Poisson;
import java.util.HashSet;
public interface DataParsing {
public HashSet<Poisson> parse(RawData data);
}

View File

@@ -0,0 +1,22 @@
package ecoparasite.poisson;
import ecoparasite.input.DataParsing;
import ecoparasite.input.RawData;
import java.util.HashSet;
public class Mackerel extends Poisson implements DataParsing {
public Mackerel(String species, Double length, Double infestation) {
super(species, length, null, infestation);
}
@Override
public HashSet<Poisson> parse(RawData data) {
HashSet<Poisson> fishSet;
fishSet = new HashSet<>();
return fishSet;
}
}

View File

@@ -0,0 +1,33 @@
package ecoparasite.poisson;
import ecoparasite.input.DataParsing;
import ecoparasite.input.RawData;
import java.util.HashSet;
public class Merlu extends Poisson implements DataParsing {
/**
* 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<Poisson> parse(RawData data) { //TODO
HashSet<Poisson> fishSet;
fishSet = new HashSet<>();
return fishSet;
}
}

View File

@@ -0,0 +1,4 @@
package ecoparasite.poisson;
public abstract class PartiePoisson {
}

View File

@@ -0,0 +1,69 @@
package ecoparasite.poisson;
import java.util.HashSet;
public class Poisson{
private String specie;
private Double length;
private Double weight;
private Double infestation;
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){
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(){
String result = "[ %5s : %4d mm, %4d g, %4d taux d'infestation ]";
return String.format(result, this.getClass().getSimpleName(), this.getLength(), this.getWeight(), this.getInfestation());
}
}