I am able to compare Strings fine, but would like to know how I can rank floating point numbers? getChange() returns a String. I want to be able to sort descending. How can I do this?
I\'m quite new to Java so this is probably pretty straight forward question. I want to sort an ArrayList in the class MediaLib based on the natural order of a specified key.
I have developed a server-to-server protocol called CCMN and different drop policies for the messages cached by each server. The PEERSIM simulator creates a template node with the CCMN protocol and th
I am trying to write a quick search that searches a List<String> Instead of looping through the list and manually checking, I want to do this using binarySearch, but I am not sure how to do it.
I have the following problem: find the highest row in a table A according to the following rules: Table A
I would like to implement a fast search on an ArrayList of objects. These objects consist of an int oldId, int newId and int inList, among with other things.
This question already has answers here: Why is "extends T" allowed but not "implements T"?
I need a comparator as part of a strategy pattern that can either use the natural ordering of the objects or some custom ordering. For the natural ordering case, I wrote a simple comparator:
As far as I know, things such as SortedMap or SortedSet, use compareTo (rather than equals) on Comparable<?> types for checking equality (contains, containsKey).
I have a method which needs a Comparator for one of its parameters. I would like to pass a Comparator which does a normal comparison and a reverse comparator which does in reverse.