diff --git a/Projet.iml b/Projet.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Projet.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/ecoparasite/input/DataParsing.java b/src/ecoparasite/input/DataParsing.java new file mode 100644 index 0000000..11847ce --- /dev/null +++ b/src/ecoparasite/input/DataParsing.java @@ -0,0 +1,10 @@ +package ecoparasite.input; + +import ecoparasite.poisson.Poisson; + +import java.util.HashSet; + +public interface DataParsing { + + public HashSet parse(RawData data); +} diff --git a/src/ecoparasite/poisson/Mackerel.java b/src/ecoparasite/poisson/Mackerel.java new file mode 100644 index 0000000..d3f442c --- /dev/null +++ b/src/ecoparasite/poisson/Mackerel.java @@ -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 parse(RawData data) { + + HashSet fishSet; + fishSet = new HashSet<>(); + + + return fishSet; + } +} diff --git a/src/ecoparasite/poisson/Merlu.java b/src/ecoparasite/poisson/Merlu.java new file mode 100644 index 0000000..941bb0a --- /dev/null +++ b/src/ecoparasite/poisson/Merlu.java @@ -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 parse(RawData data) { //TODO + + HashSet fishSet; + fishSet = new HashSet<>(); + + + return fishSet; + } +} diff --git a/src/ecoparasite/poisson/PartiePoisson.java b/src/ecoparasite/poisson/PartiePoisson.java new file mode 100644 index 0000000..63d1a1c --- /dev/null +++ b/src/ecoparasite/poisson/PartiePoisson.java @@ -0,0 +1,4 @@ +package ecoparasite.poisson; + +public abstract class PartiePoisson { +} diff --git a/src/ecoparasite/poisson/Poisson.java b/src/ecoparasite/poisson/Poisson.java new file mode 100644 index 0000000..92815b2 --- /dev/null +++ b/src/ecoparasite/poisson/Poisson.java @@ -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 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()); + } +}