Connecting Tech Pros Worldwide Forums | Help | Site Map

implementing Icomparable for multiple sort fields

jw56578@gmail.com
Guest
 
Posts: n/a
#1: Nov 17 '05
What is a good method to sort objects in an arraylist by more than 1
field.


Morten Wennevik
Guest
 
Posts: n/a
#2: Nov 17 '05

re: implementing Icomparable for multiple sort fields


Hi jw56578,

Well, you could do all necessary algorithms within the scope of the IComparable methods, or keep the regular comparing simple and use an IComparer object to sort with. Not sure if this is the answer you seek though.


On Mon, 19 Sep 2005 19:13:22 +0200, <jw56578@gmail.com> wrote:
[color=blue]
> What is a good method to sort objects in an arraylist by more than 1
> field.
>
>[/color]



--
Happy coding!
Morten Wennevik [C# MVP]
Jeff Louie
Guest
 
Posts: n/a
#3: Nov 17 '05

re: implementing Icomparable for multiple sort fields


This may help get you started:
http://www.geocities.com/jeff_louie/OOP/oop15.htm

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Closed Thread


Similar C# / C Sharp bytes