You aren't using pairs of names and values; you have the same value for everything, so you don't need the Map. If you hack into the source code for HashSet, you will find that is rather like the implementation for HashSet. If you always put "cu" as the value, then you don't need a Map.
If you had been using Russian letters, I thought, it have might be possible to extract the letters and subtract them from each other, if they are in the order of the Russian
alphabet.
I could suggest an alteration to the Comparator, which will need a Map
If you are certain that you will always be using two letters and _ followed by an integer number, try splitting the
String on the _ with the String#split method.
You need to check in a regular expressions tutorial, however, maybe this one, that _ is not a meta-character. If it is you might have to use \_ or \\_ instead of _ to split. Then you will have a String like au bu cu du and a number. Now put some values in a Map<String, Integer> in the Comparator
You now have two Strings, so you can use compMap.get(s1) + Integer.parseInt(s2) for one of the objects and similar for the other. As long as you restrict the values "put" in the Map to not more than 9 digitrs, you shouldn't have any problems with arithmetic overflow. Now your compare() method can simply subtract those two numbers.
AdvantagesYou can put the values in any order you like.You can add values, for example "at" -1000 and "as" -2000, as many as you like, until your patience runs out or your method is ≥64kB on disc.You can put pairs of Strings and number values in a text file and read that text file (maybe with a Scanner) and populate your Map from that, instead.DisadvantagesYou are liable to suffer NullPointerExceptions if you try non-existent keys, eg "ar", but a containsKey() check may allow you to return a default value, eg 0, instead.You must ensure the second part of the String really constitutes an int.The values I have suggested allow for up to 3 digits for the number part, so you might have to change the values.