FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java/MapSort/src/com/hmkcode/MapSort.java at master · afdp07/Java · GitHub
afdp07
Java
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Java
/
MapSort
/
src
/
com
/
hmkcode
/
MapSort.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (15 loc) · 414 Bytes
Breadcrumbs
Java
/
MapSort
/
src
/
com
/
hmkcode
/
MapSort.java
Copy path
File metadata and controls
19 lines (15 loc) · 414 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package
com
.
hmkcode
;
import
java
.
util
.
Map
;
import
java
.
util
.
TreeMap
;
public
class
MapSort
{
public
static
Map
sortByValue
(
Map
unsortedMap
){
Map
sortedMap
=
new
TreeMap
(
new
ValueComparator
(
unsortedMap
));
sortedMap
.
putAll
(
unsortedMap
);
return
sortedMap
;
}
public
static
Map
sortByKey
(
Map
unsortedMap
){
Map
sortedMap
=
new
TreeMap
();
sortedMap
.
putAll
(
unsortedMap
);
return
sortedMap
;
}
}
Back
|
FazBrowse Home
|
New Git URL