java.lang.Objectquestion1.ListeImpl
public class ListeImpl
Constructor Summary | |
---|---|
ListeImpl(String nom)
Creation d'une liste. |
Method Summary | |
---|---|
boolean |
ajouter(String elt)
Ajout d'un element a la liste. |
boolean |
estPresent(String elt)
Test de la presence d'un element. |
Iterator<String> |
iterator()
Parcours de la liste. |
boolean |
restaurer()
optionnel ... |
boolean |
retirer(String elt)
Retrait de toutes les occurrences de cet element de la liste |
int |
taille()
Obtention du nombre d'elements. |
String |
toString()
Obtention d'une liste sous ce format "[elt1, elt2, |
boolean |
vider()
Vider cette liste (ou le retrait de tous les elements). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ListeImpl(String nom)
nom
- le nom de cette listeMethod Detail |
---|
public boolean ajouter(String elt)
Liste
ajouter
in interface Liste<String>
elt
- l'element a ajouter
public boolean estPresent(String elt)
Liste
estPresent
in interface Liste<String>
elt
- l'element a comparer
public Iterator<String> iterator()
Liste
iterator
in interface Iterable<String>
iterator
in interface Liste<String>
public boolean restaurer()
restaurer
in interface Liste<String>
public boolean retirer(String elt)
Liste
retirer
in interface Liste<String>
elt
- l'element a retirer
public int taille()
Liste
taille
in interface Liste<String>
public String toString()
Liste
toString
in interface Liste<String>
toString
in class Object
public boolean vider()
Liste
vider
in interface Liste<String>