Sorting an ArrayList by the value of a field in the objects it stores
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3342517/sorting-arraylist-of-objects-by-object-attribute">Sorting ArrayList of Objects by Object attribute</a>  </p>
</blockquote>



<p>Basically I have an ArrayList that stores objects, each of those objects has a field that stores an integer. I want to store the objects in my ArrayList by acending order of that integer.</p>

<p>Is there an easy way to do this, I've looked around the Java API doc but can't find anything that looks suitable, sorry if this is trivial but it sounds like it should be simple enough if I can just find the right documentation. </p>

<p>Thanks</p>
