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

13
LINES

< > BotCompany Repo | #1018921 // sortedByFieldAlphaNumDesc - use AlphanumComparator

JavaX fragment (include)

1  
static <A> L<A> sortedByFieldAlphaNumDesc(Collection<A> c, final S field) {
2  
  L<A> l = new ArrayList(c);
3  
  sort(l, new Comparator<A>() {
4  
    public int compare(A a, A b) {
5  
      ret alphaNumComparator().compare((S) getOpt(b, field), (S) getOpt(a, field));
6  
    }
7  
  });
8  
  ret l;
9  
}
10  
11  
static <A> L<A> sortedByFieldAlphaNumDesc(S field, Collection<A> c) {
12  
  ret sortedByFieldAlphaNumDesc(c, field);
13  
}

Author comment

Began life as a copy of #1014032

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018921
Snippet name: sortedByFieldAlphaNumDesc - use AlphanumComparator
Eternal ID of this version: #1018921/1
Text MD5: 7d7027f08c1bd6144842bdf597fa0707
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-15 23:58:33
Source code size: 406 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 299 / 349
Referenced in: [show references]