Eventuali duplicati:
Sorting an ArrayList of ContactsOrdina un ArrayList in base a un campo di oggetto
Sto immagazzinando DataNode
oggetti in un ArrayList
. La classe DataNode
ha un campo intero chiamato degree
. Desidero recuperare gli oggetti DataNode
da nodeList nell'ordine crescente di degree
. Come posso farlo.
List<DataNode> nodeList = new ArrayList<DataNode>();
Eventuali duplicati di http://stackoverflow.com/questions/2784514/sort-arraylist-of-custom-objects-by-property –
Su una seconda tought http : //stackoverflow.com/questions/1814095/sorting-an-arraylist-of-contacts potrebbe essere più vicino a questo –
Vedere anche http://stackoverflow.com/questions/2535124/how-to-sort-an-arraylist- of-objects-by-a-property –