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)

static <A> L<A> sortedByFieldAlphaNumDesc(Collection<A> c, final S field) {
  L<A> l = new ArrayList(c);
  sort(l, new Comparator<A>() {
    public int compare(A a, A b) {
      ret alphaNumComparator().compare((S) getOpt(b, field), (S) getOpt(a, field));
    }
  });
  ret l;
}

static <A> L<A> sortedByFieldAlphaNumDesc(S field, Collection<A> c) {
  ret sortedByFieldAlphaNumDesc(c, field);
}

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: 298 / 347
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)