Hi,
I have been trying to figure out how to create a custom comparator that I can use to handle a list of items of a user defined data type. For instance:
class mytype
{
int a;
String b;
String c;
URL d;
}
If I want a comparator that can order these items by int a, how could I construct it...and use it. I know that there must be a way as Java has a Comparator interface.
thanks
Brinker
I have been trying to figure out how to create a custom comparator that I can use to handle a list of items of a user defined data type. For instance:
class mytype
{
int a;
String b;
String c;
URL d;
}
If I want a comparator that can order these items by int a, how could I construct it...and use it. I know that there must be a way as Java has a Comparator interface.
thanks
Brinker