Created
May 5, 2015 21:42
-
-
Save ilyeshammadi/40ae55e3828246eb8684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* Created by Ilyes Hammadi on 04/05/2015. | |
*/ | |
public class Adherant extends Personne { | |
private int numeroAdherant; | |
private List<ArticleMediatheque> articles = new ArrayList<ArticleMediatheque>(); | |
public Adherant(String nom, Adresse adresse) { | |
super(nom, adresse); | |
this.numeroAdherant = numeroAdherant; | |
this.articles = articles; | |
} | |
public List<ArticleMediatheque> getArticles() { | |
return articles; | |
} | |
public void setArticles(List<ArticleMediatheque> articles) { | |
this.articles = articles; | |
} | |
public int getNumeroAdherant() { | |
return numeroAdherant; | |
} | |
public void setNumeroAdherant(int numeroAdherant) { | |
this.numeroAdherant = numeroAdherant; | |
} | |
public void ajouterArticle(ArticleMediatheque articleMediatheque) { | |
articles.add(articleMediatheque); | |
} | |
public void afficherArticle() { | |
for (int i = 0; i < articles.size(); i++) { | |
System.out.println(i + 1 + ")" + articles.get(i).getTitre()); | |
} | |
} | |
public ArticleMediatheque rendreArticle(int indice) { | |
return articles.get(indice); | |
} | |
public void supprimerArticle(int indice) { | |
articles.remove(indice); | |
} | |
public int nombreArticle() { | |
return articles.size(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment