View Single Post
Old Nov 25th, 2005, 3:17 PM   #5
säkki
Newbie
 
Join Date: Feb 2005
Posts: 9
Rep Power: 0 säkki is on a distinguished road
Quote:
Originally Posted by Arevos
Yes, you're right. Though, if you have Java 1.5:
Collections.sort(cInd, new Comparator<Person>() {
   int compare(Person a, Person b) {
      return a.getLastName().compareTo(b.getLastName());
   }
});
(Assuming cInd is descended from List<Person>)
well it actually isn't descended from List<Person>, if I understand what you mean. cInd contains three kind of "persons" could be like this:
cInd {Person("FN", "LN"), Student("FN", "LN"), Worker("FN", "LN")} <- not meant to be anykind of syntax just to clarify things.
Student and Worker are descended from Person.

Thanks for these tips allready, I'll try to get forward in this but I really am miserable in this.
säkki is offline   Reply With Quote