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

13
LINES

< > BotCompany Repo | #1018326 // sortByCalculatedFieldDesc_inPlace

JavaX fragment (include)

1  
// f: A -> Comparable
2  
static <A> L<A> sortByCalculatedFieldDesc_inPlace(L<A> l, fO f) {
3  
  sort(l, new Comparator<A>() {
4  
    public int compare(A b, A a) {
5  
      ret stdcompare((O) callF(f, a), (O) callF(f, b));
6  
    }
7  
  });
8  
  ret l;
9  
}
10  
11  
static <A> L<A> sortByCalculatedFieldDesc_inPlace(O f, L<A> c) {
12  
  ret sortByCalculatedFieldDesc_inPlace(c, f);
13  
}

Author comment

Began life as a copy of #1006868

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: #1018326
Snippet name: sortByCalculatedFieldDesc_inPlace
Eternal ID of this version: #1018326/4
Text MD5: d2b31b9056a972d011e3415657e4875f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-22 13:08:25
Source code size: 360 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 405 / 448
Version history: 3 change(s)
Referenced in: [show references]