Top "Comparator" questions

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

TreeSet and equals function

There is a Java bean object which has implemented equals function based on certain criteria (Criteria A). I have a …

java equals comparator treeset
Does Collections.sort keep order on equal elements?

I have a list of objects ordered by a date parameter and want to reorder them by category parameter, but …

java sorting collections comparator
Trouble setting a column comparator to a JTable

In another thread I found this comparator (bottom of post) for sorting JTable columns that could be composed of integers, …

java swing jtable comparator tablerowsorter
In Java, is a Comparator used in Collections.sort() thread safe?

If I create a single instance of a Comparator, can that instance be used across multiple threads to sort collections …

java thread-safety comparator
Chain of comparators in java

Reading the Java Tutorial by Oracle on interfaces which gives a example on Card (Playing cards) I was trying to …

java java-8 comparator