title: sort list of objects by return of object method
body: <p>I've got a list of objects, that have a function which does some calculations on several member variables and returns a value. I want to sort the list according to this return value.</p>
  
  <p>I've found how to sort a list of objects by member variables but I want to keep them private (<code>_variable_name</code>).</p>
  
  <p>Is there an easy way to accomplish this similar to the method of sorting the list directly by the members of the objects?</p>