package data.file; import java.util.Comparator; import java.util.Map; public class DuplicateValueComparator implements Comparator<String> { Map<String, Integer> base; public DuplicateValueComparator(Map<String, Integer> base) { this.base = base; } // Note: this comparator imposes orderings that are inconsistent with equals. public int compare(String a, String b) { if (base.get(a) < base.get(b)) { return 1; } else if(base.get(a) == base.get(b)){ return 0; } // returning 0 would merge keys return -1; } }

qiuyuqiuyuqiuyu
2023年5月25日
暂无贡献等级
Irene777 LV1
2022年2月24日
2898369623 LV1
2021年10月12日
1798672867 LV21
2021年7月18日
哎呀 LV1
2021年5月15日
2018ly
2021年5月13日
暂无贡献等级
FshfshFsh LV2
2021年3月7日
2196316269 LV10
2021年2月24日
litaosb LV5
2020年12月14日
532069753 LV3
2020年5月1日