I have an ArrayList
which contains a list of Train
s:
package train;
public class Train {
private String nom;
private String villeDepart, villeArrivee;
public Train() {
super();
// TODO Auto-generated constructor stub
}
public Train(String nom, String villeDepart, String villeArrivee) {
super();
this.nom = nom;
this.villeDepart = villeDepart;
this.villeArrivee = villeArrivee;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getVilleDepart() {
return villeDepart;
}
public void setVilleDepart(String villeDepart) {
this.villeDepart = villeDepart;
}
public String getVilleArrivee() {
return villeArrivee;
}
public void setVilleArrivee(String villeArrivee) {
this.villeArrivee = villeArrivee;
}
}
I want to search the ArrayList
by villeDepart
and villeArrivee
. How can I do this?