Re: Sorting based on multiple parameters




Manish Hatwalne wrote:

"Jeff Higgins" <oohiggins@xxxxxxxxx> wrote in message
news:8VB_i.1$wL7.0@xxxxxxxxxxxxxxx


I am not sure if you understood the question.

"Or in other words, how do I write comparator for following method?"

I am writing thi smethod, and wondering how do I go about writing
compareTo method for multiple parameters.

Comparator interface has no compareTo method.
Comparable interface has a single method:
int compareTo(T o).


.



Relevant Pages

  • Re: Sorting based on multiple parameters
    ... Manish Hatwalne wrote: ... how do I write comparator for following method?" ... I am writing thi smethod, and wondering how do I go about writing compareTo method for multiple parameters. ... public int compareTo{ ...
    (comp.lang.java.programmer)
  • Re: difference between comparator and comparable interface
    ... >> what's the difference between comparable and comparator interface. ... > For example, Strings compare themselves alphabetically (well, by character ... The Comparator interface is then used to create exotic orders, ...
    (comp.lang.java.programmer)
  • Re: difference between comparator and comparable interface
    ... >> what's the difference between comparable and comparator interface. ... > For example, Strings compare themselves alphabetically (well, by character ... The Comparator interface is then used to create exotic orders, ...
    (comp.lang.java.help)
  • Re: sorting arrays
    ... You need a new class which binds teh related items together. ... public class MyClass implements Comparable ... Look up the Comparable and Comparator interface. ...
    (comp.lang.java.help)
  • Re: sorting arrays
    ... >> public MyClass(String fromString, String codeString, String toString) ... >> Look up the Comparable and Comparator interface. ... > Hi Nige, ...
    (comp.lang.java.help)