package persons;

/**
 * Created by fcmam5 on 11/13/15.
 * Implemented by nesrinehanane
 */
 public class Personne {
  private int id;
    private String name;
    private String firstName;
    private String grouping; //on peut 'enlever mais au cas ou le med est un donneur'
    private int age;
    private String adresse[] = new String[2]; // [ "Wilaya" || "Daira"]
    private String mail;
    private int phoneNumber;
    


    public Personne(char id, String name, String firstName, int age, String grouping , String adresse_given[],String mail, int phoneNumber){
        this.id=id;
        this.grouping=grouping;
        this.name=name;
        this.firstName=firstName;
        this.age = age;
        this.mail=mail;
        this.phoneNumber=phoneNumber;
        /**
         * adresse_given[0] should be "Wilaya"
         * adresse_given[1] should be "Daira"
         */
        this.adresse[0]=adresse_given[0];
        this.adresse[1]=adresse_given[1];

    }

    /*this one is for the doctor and the admin */
    public Personne(int id,String name, String firstName,String mail,int phoneNumber,String adresse_given[] ){
        this.id=id;
        this.name=name;
        this.firstName=firstName;
        this.phoneNumber=phoneNumber;
         this.adresse[0]=adresse_given[0];
        this.adresse[1]=adresse_given[1];
        this.mail=mail;
        
        
    }


    public void setName(String name){
        this.name=name;
    }
    public String getName(){
        return this.name;
    }
    public void setFirstName(String firstName){
        this.firstName=firstName;
    }
    public String getFirstName(){
        return this.firstName;
    }
    public void setGrouping(String grouping){
        this.grouping=grouping;
    }
    public String getGrouping(){
        return this.grouping;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String[] getAdresse() {
        return adresse;
    }

    public void setAdresse(String[] adresse) {
        this.adresse = adresse;
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the mail
     */
    public String getMail() {
        return mail;
    }

    /**
     * @param mail the mail to set
     */
    public void setMail(String mail) {
        this.mail = mail;
    }

    /**
     * @return the phoneNumber
     */
    public int getPhoneNumber() {
        return phoneNumber;
    }

    /**
     * @param phoneNumber the phoneNumber to set
     */
    public void setPhoneNumber(int phoneNumber) {
        this.phoneNumber = phoneNumber;
    }
 }

@@ -306,267 +306,424 @@
 ate 
-String adresse%5B%5D = new String%5B2%5D; // %5B %22Wilaya%22 %7C%7C %22Daira%22%5D%0A    private String mail;%0A    private int phoneNumber;%0A    %0A%0A%0A    public Personne(char id, String name, String firstName, int age, String grouping , String adresse_given%5B%5D,String mail, int phoneNumber
+double poids;%0A    private Adresse adresse;%0A    private String mail;%0A    private int phoneNumber;%0A     %0A    String Dayra = null;%0A    String Wilaya = null;%0A%0A%0A    public Personne(%0A            int id, %0A            String name, %0A            String firstName, %0A            int age, %0A            String grouping , %0A            Adresse adresse,%0A            String mail, %0A            int phoneNumber,%0A            double poids
 )%7B%0A 
@@ -929,66 +929,33 @@
     
-/**%0A         * adresse_given%5B0%5D should be %22Wilaya%22
+this.poids=poids;
 %0A       
   * 
@@ -954,19 +954,16 @@
     
-  *
  adresse
 _giv
@@ -962,45 +962,33 @@
 esse
-_given%5B1%5D should be %22Daira%22%0A 
+.setDayra(Dayra);
         
 */%0A 
@@ -979,26 +979,24 @@
 ra);        
-*/
 %0A        thi
@@ -996,83 +996,42 @@
     
-this.
 adresse
-%5B0%5D=adresse_given%5B0%5D;%0A        this.adresse%5B1%5D=adresse_given%5B1%5D;
+.setWilaya(Wilaya);%0A       
 %0A%0A  
@@ -1109,98 +1109,177 @@
 nne(
-int id,String name, String firstName,String mail,int phoneNumber,String adresse_given%5B%5D )%7B
+%0A            int id,%0A            String name, %0A            String firstName,%0A            String mail,%0A            int phoneNumber,%0A            Adresse adresse)%7B%0A        
 %0A   
@@ -1403,41 +1403,22 @@
     
- 
 this.
-adresse%5B0%5D=adresse_given%5B0%5D
+mail=mail
 ;%0A  
@@ -1427,64 +1427,74 @@
     
-this.
 adresse
-%5B1%5D=adresse_given%5B1%5D;%0A        this.mail=mail
+.setDayra(Dayra);        %0A        adresse.setWilaya(Wilaya)
 ;%0A  
@@ -2085,155 +2085,13 @@
     
-public String%5B%5D getAdresse() %7B%0A        return adresse;%0A    %7D%0A%0A    public void setAdresse(String%5B%5D adresse) %7B%0A        this.adresse = adresse;%0A    %7D%0A
+%0A    
 %0A   
@@ -2781,12 +2781,492 @@
 r;%0A    %7D
+%0A%0A    /**%0A     * @return the poids%0A     */%0A    public double getPoids() %7B%0A        return poids;%0A    %7D%0A%0A    /**%0A     * @param poids the poids to set%0A     */%0A    public void setPoids(double poids) %7B%0A        this.poids = poids;%0A    %7D%0A%0A    /**%0A     * @return the adresse%0A     */%0A    public Adresse getAdresse() %7B%0A        return adresse;%0A    %7D%0A%0A    /**%0A     * @param adresse the adresse to set%0A     */%0A    public void setAdresse(Adresse adresse) %7B%0A        this.adresse = adresse;%0A    %7D
 %0A %7D%0A

Update Personne.java