Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package banque_package;
- import java.util.ArrayList;
- public class Client {
- protected String nomClient;
- protected String mdp;
- public ArrayList<Compte> comptes = new ArrayList<Compte>();
- public ArrayList<Compte> beneficiaires = new ArrayList<Compte>();
- //============CONSTRUCTEURS==============
- public Client(){
- nomClient = "Inconnu";
- mdp = "Inconnu";
- System.out.println("Votre compte client a bien été crée !");
- }
- public Client(String pNom, String pMdp){
- nomClient = pNom;
- mdp = pMdp;
- System.out.println("Votre compte client a bien été crée !");
- }
- //==============ACCESSEURS================
- public String getNom() {
- return nomClient;
- }
- public int getNbrComptes() {
- return comptes.size();
- }
- public Compte getCompte(int indexCompte)
- {
- return comptes.get(indexCompte);
- }
- public Compte getBenef(int indexCompte)
- {
- return beneficiaires.get(indexCompte);
- }
- public ArrayList<Compte> getComptes() {
- return comptes;
- }
- public ArrayList<Compte> getBeneficiaires() {
- return beneficiaires;
- }
- public String getNomBeneficiaire(int numBenef) {
- Compte beneficiaire = beneficiaires.get(numBenef);
- return beneficiaire.nomBenef;
- }
- //==============MUTATEURS================
- public void setNom(String pNom) {
- nomClient = pNom;
- }
- public void addCompte(Compte numCompte)
- {
- comptes.add(numCompte);
- }
- public void deleteCompte(int refCompte)
- {
- comptes.remove(refCompte);
- }
- public void addBeneficiaire(Compte nomBenef)
- {
- beneficiaires.add(nomBenef);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement