A lot of things².
- Change DataParsing to a generic interface. - Add PartiePoisson - Add comments to Population class.
This commit is contained in:
@@ -9,7 +9,21 @@ import java.util.HashSet;
|
||||
*/
|
||||
public interface DataParsing {
|
||||
|
||||
public static HashSet<Poisson> parse(RawData data) throws RawDataOverflow {
|
||||
/**
|
||||
* Permet de parser un élément à partir d'un objet RawData.
|
||||
* @param data l'objet RawData
|
||||
* @param parseTypeId Permet d'indiquer le type de Parsing que l'on veut.
|
||||
* @return Un HashSet de données T retourné.
|
||||
* @param <T> Notre paramètre générique adaptable à plusieurs classes.
|
||||
* @throws RawDataOverflow Si on dépasse la taille de l'objet RawData.
|
||||
* @throws InvalidParsingException Si le type de parsing n'existe pas.
|
||||
*/
|
||||
public static <T> HashSet<T> parse(RawData data, int parseTypeId ) throws RawDataOverflow, InvalidParsingException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T> HashSet<T> parse(RawData data) throws RawDataOverflow, InvalidParsingException {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
37
src/ecoparasite/input/InvalidParsingException.java
Normal file
37
src/ecoparasite/input/InvalidParsingException.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package ecoparasite.input;
|
||||
|
||||
/**
|
||||
* Gère une exception lorsque qu'un type de parsing n'existe pas ou bien
|
||||
* qu'une erreur est survenue durant le parsing d'une donnée.
|
||||
*/
|
||||
public class InvalidParsingException extends Exception {
|
||||
|
||||
/**
|
||||
* L'ID du parsing voulant être réalisé.
|
||||
*/
|
||||
private int parsingId;
|
||||
|
||||
/**
|
||||
* De quel classe provient ce parsing.
|
||||
*/
|
||||
private String parsingSource;
|
||||
|
||||
/**
|
||||
* Constructeur.
|
||||
* @param parsingId ID du parsing
|
||||
* @param parsingSource La classe d'où provient ce parsing.
|
||||
*/
|
||||
public InvalidParsingException(int parsingId, String parsingSource) {
|
||||
this.parsingId = parsingId;
|
||||
this.parsingSource = parsingSource;
|
||||
super();
|
||||
}
|
||||
|
||||
public int getParsingId() {
|
||||
return parsingId;
|
||||
}
|
||||
public String getParsingSource() {
|
||||
return parsingSource;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class RawData {
|
||||
* Permet d'obtenir tous les champs d'une entrée.
|
||||
* @param index Entrée que vous voulez obtenir, le minimum est l'entrée 1. Le maximum dépend du Dataframe.
|
||||
* @return Une HashMap <colonne, valeur>.
|
||||
* @throws RawDataOverflow Si vous avez dépasses le maximum d'entrées du DataFrame.
|
||||
* @throws RawDataOverflow Si vous avez dépassé le maximum d'entrées du DataFrame.
|
||||
*/
|
||||
public HashMap<String,String> getEntry(int index) throws RawDataOverflow {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user