(String[] args)
| 71 | return result; |
| 72 | } |
| 73 | public static void main (String[] args) { |
| 74 | Map<String, String> map = new TreeMap<String, String>(); |
| 75 | map.put("AKFC", "4kfc"); |
| 76 | map.put("BWNBA", "3wnba"); |
| 77 | map.put("CNBA", "2nba"); |
| 78 | map.put("DCBA", "1cba"); |
| 79 | Map<String, String> resultMap = sortMapByKey(map,"ASCENDING"); //��Key������������ |
| 80 | System.out.println("key ����"); |
| 81 | for (Map.Entry<String, String> entry : resultMap.entrySet()) { |
| 82 | System.out.println(entry.getKey() + " " + entry.getValue()); |
| 83 | } |
| 84 | System.out.println("key ����"); |
| 85 | Map<String, String> resultMap1 = sortMapByKey(map,"DESCENDING"); //��Key��������� |
| 86 | for (Map.Entry<String, String> entry : resultMap1.entrySet()) { |
| 87 | System.out.println(entry.getKey() + " " + entry.getValue()); |
| 88 | } |
| 89 | System.out.println("value ����"); |
| 90 | Map<String, String> resultMap2 = sortMapByValue(map, "ASCENDING"); //��Value�������� |
| 91 | for (Map.Entry<String, String> entry : resultMap2.entrySet()) { |
| 92 | //System.out.println(entry.getKey() + " " + entry.getValue()); |
| 93 | System.out.println(entry); |
| 94 | } |
| 95 | |
| 96 | System.out.println("vale ����"); |
| 97 | Map<String, String> resultMap3 = sortMapByValue(map, "DESCENDING"); //��Value�������� |
| 98 | for (Map.Entry<String, String> entry : resultMap3.entrySet()) { |
| 99 | //System.out.println(entry.getKey() + " " + entry.getValue()); |
| 100 | System.out.println(entry); |
| 101 | } |
| 102 | System.out.println(combineMapEntry(resultMap1, false,"&")); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | //�Ƚ����� |
nothing calls this directly
no test coverage detected