comparator
Java Serialization Comparator
Is it possible to serialize a TreeMap with a comparator?? 开发者_运维百科I\'ve tested and it serializes well a treemap without comparator, when you add the comparator, it throws an exception.[详细]
2022-12-13 20:20 分类:问答Can I use a Comparator without implementing Comparable?
Is it possible to use a Comparator without implementing开发者_运维百科 the Comparable class? For instance, if I had the following:[详细]
2022-12-13 07:14 分类:问答Java Collections.sort - help me remove the unchecked warning
List<Question> questions = new ArrayList<Question>(); quest开发者_运维百科ions.addAll(getAllQuestions()); //returns a set of Questions[详细]
2022-12-12 18:19 分类:问答Java TreeMap (comparator) and get method ignoring the comparator
public final Comparator<String> ID_IGN_CASE_COMP = new Comparator<String>() { public int compare(String s1, String s2) {[详细]
2022-12-12 11:34 分类:问答How do I sort enum members alphabetically in Java?
I have an enum class like the following: public enum Letter { OMEGA_LETTER(\"Omega\"), GAMMA_LETTER(\"Gamma\"),[详细]
2022-12-11 05:33 分类:问答Java, how to add a "comparator" class to increase code reusability
Preface: I\'m posting this on behalf of a friend (who\'s apparently to shy to post it himself), I browsed throu开发者_Go百科gh the related questions and I didn\'t seem to find any duplicate.. But do n[详细]
2022-12-10 05:48 分类:问答How can I compare null values using Comparator?
I\'ve got a few Comparators -- one for Dates, one for decimals, one for percentages, etc. At first my decimal comparator looked like this:[详细]
2022-12-10 04:10 分类:问答STL Priority Queue on custom class
I\'m having a lot of trouble getting my priority queue to recognize which parameter it should sort by. I\'ve overloaded the less than operator in my custom class but it doesn\'t seem to use it. Here\'[详细]
2022-12-08 16:19 分类:问答Java: Trouble with TreeSet and LinkedList
I have an unsorted linked list. To sort it, I thought I\'d put the values into a TreeSet with a comparator supplied, then return those values as a new linked list. Yet, it fails.[详细]
2022-12-08 02:09 分类:问答