Advertisement
Guest User

Client.java

a guest
Oct 8th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 2.07 KB | None | 0 0
  1. package banque_package;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. public class Client {
  6.    
  7.     protected String nomClient;
  8.    
  9.     protected String mdp;
  10.    
  11.     public ArrayList<Compte> comptes = new ArrayList<Compte>();
  12.    
  13.     public ArrayList<Compte> beneficiaires = new ArrayList<Compte>();
  14.    
  15.    
  16.     //============CONSTRUCTEURS==============
  17.    
  18.     public Client(){
  19.  
  20.         nomClient = "Inconnu";
  21.        
  22.         mdp = "Inconnu";
  23.        
  24.         System.out.println("Votre compte client a bien été crée !");
  25.  
  26.       }
  27.    
  28.    
  29.     public Client(String pNom, String pMdp){
  30.        
  31.         nomClient = pNom;
  32.        
  33.         mdp = pMdp;
  34.        
  35.         System.out.println("Votre compte client a bien été crée !");
  36.     }
  37.      
  38.    
  39.     //==============ACCESSEURS================
  40.    
  41.    
  42.     public String getNom() {
  43.        
  44.         return nomClient;
  45.        
  46.     }
  47.    
  48.     public int getNbrComptes() {
  49.        
  50.         return comptes.size();
  51.     }
  52.    
  53.     public Compte getCompte(int indexCompte)
  54.     {
  55.         return comptes.get(indexCompte);
  56.     }
  57.    
  58.     public Compte getBenef(int indexCompte)
  59.     {
  60.         return beneficiaires.get(indexCompte);
  61.     }
  62.    
  63.     public ArrayList<Compte> getComptes() {
  64.        
  65.         return comptes;
  66.        
  67.     }
  68.    
  69.     public ArrayList<Compte> getBeneficiaires() {
  70.        
  71.         return beneficiaires;
  72.        
  73.     }
  74.    
  75.    
  76.    
  77.     public String getNomBeneficiaire(int numBenef) {
  78.        
  79.         Compte beneficiaire = beneficiaires.get(numBenef);
  80.        
  81.         return beneficiaire.nomBenef;
  82.        
  83.     }
  84.    
  85.    
  86.    
  87.     //==============MUTATEURS================
  88.  
  89.    
  90.     public void setNom(String pNom) {
  91.        
  92.         nomClient = pNom;
  93.        
  94.     }
  95.    
  96.     public void addCompte(Compte numCompte)
  97.     {
  98.         comptes.add(numCompte);
  99.     }
  100.    
  101.     public void deleteCompte(int refCompte)
  102.     {
  103.         comptes.remove(refCompte);
  104.     }
  105.    
  106.     public void addBeneficiaire(Compte nomBenef)
  107.     {
  108.         beneficiaires.add(nomBenef);
  109.     }
  110.    
  111.    
  112.    
  113.    
  114.    
  115.    
  116.    
  117.    
  118.    
  119.    
  120.    
  121.    
  122.    
  123.    
  124.    
  125.    
  126.    
  127.    
  128.    
  129.  
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement