Commit 15:18
javadoc
This commit is contained in:
@@ -10,32 +10,60 @@ public class Poisson{
|
||||
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(){
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user