A lot of things.

- Change tests directory location.
- Fix Merlu CSV UTF8 encoding.
- Make classes for ParasitesPeru2021.csv Parsing.
This commit is contained in:
2026-03-31 19:00:19 +02:00
parent 2bf0ca34df
commit 3a6968f40f
17 changed files with 441 additions and 59 deletions

View File

@@ -29,8 +29,7 @@ public class Mackerel extends Poisson implements DataParsing {
* @param data
* @return tableau des poissons
*/
@Override
public HashSet<Poisson> parse(RawData data) throws RawDataOverflow {
public static HashSet<Poisson> parse(RawData data) throws RawDataOverflow {
HashMap<String,String> temp = new HashMap<>();

View File

@@ -29,8 +29,7 @@ public class Merlu extends Poisson implements DataParsing {
* @param data
* @return tableau des poissons
*/
@Override
public HashSet<Poisson> parse(RawData data) throws RawDataOverflow {
public static HashSet<Poisson> parse(RawData data) throws RawDataOverflow {
HashMap<String,String> temp = new HashMap<>();
@@ -39,7 +38,7 @@ public class Merlu extends Poisson implements DataParsing {
for (int i = 0; i < data.getData().getFirst().size(); i++) {
temp = data.getEntry(i);
Poisson newP = new Merlu(temp.get("nom.merlu"),valueOf(temp.get("m.size")),valueOf(temp.get("number of Anisakis sp L3")));
Poisson newP = new Merlu(temp.get("nom.merlu"),valueOf(temp.get("m.size (mm)")),valueOf(temp.get("number of Anisakis sp L3")));
fishSet.add(newP);
}

View File

@@ -67,7 +67,7 @@ public class Poisson{
*/
@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());
String result = "[ %5s : %4f mm, %4f g, %4f taux d'infestation ]";
return String.format(result, this.getClass().getSimpleName(), this.getLength(), this.getWeight(), this.getInfestation() );
}
}