Aspects


vs


Comparable

In Java, this interface is implemented by a class to indicate that it can be compared to another object and therefore ordered.

Comparator

A Common interface to create an object that specifies the way of comparing other objects

Others

Quality Example
Easier

"Using just the keyfn return a comparable value that matches your requirements is much easier than implementing comparator"

from question "Clojure: sort-by nested map custom comparator"

Class better

"A comparator class is better since use of comparable would mean using"

from question "Deciding to use Comparable or Comparator"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0