I have this Object :
public class AdresseReponse {
private String nom;
private String numero;
private String rue;
private String codePostal;
private String ville;
private String region;
private String pays;
private Coordonnee coordonnees;
private double distanceFromThePrevious;
private int number;
// + all setters & getters
}
In a other class, I have an ArrayList :
ArrayList<AdresseReponse> etapes = new ArrayList<AdresseReponse>();
and this methode :
public void testSort( AdresseReponse depart, AdresseReponse etape ) throws IOException, _Exception {...}
In this method, I do :
etapes.add(etape);
After, I need to sort etapes by distanceFromThePrevious.
How can I do this ?