Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1021848 // sortByMapKeyAlphaNum

JavaX fragment (include)

static <B, A extends Map<B, ? super S>> L<A> sortByMapKeyAlphaNum(Iterable<A> c, final B key) {
  L<A> l = cloneList(c);
  sort(l, new Comparator<A>() {
    public int compare(A a, A b) {
      ret cmpAlphaNum((S) mapGet((Map) a, (O) key), (S) mapGet((Map) b, (O) key));
    }
  });
  ret l;
}

Author comment

Began life as a copy of #1021847

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021848
Snippet name: sortByMapKeyAlphaNum
Eternal ID of this version: #1021848/4
Text MD5: 73ca96677dc82367ae5c9b1a0f18cf33
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-02 14:39:46
Source code size: 301 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 329 / 346
Version history: 3 change(s)
Referenced in: [show references]