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

7
LINES

< > BotCompany Repo | #1001539 // sortByIndex - sort by element at index

JavaX fragment (include)

1  
static void sortByIndex(L<L> l, final int index) {
2  
  sort(l, new Comparator<L>() {
3  
    public int compare(L a, L b) {
4  
      ret cmp(a.get(index), b.get(index));
5  
    }
6  
  });
7  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001539
Snippet name: sortByIndex - sort by element at index
Eternal ID of this version: #1001539/4
Text MD5: c19c9389a327a9f3d0ea0e8377c7ff5d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-18 02:41:59
Source code size: 180 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 636 / 828
Version history: 3 change(s)
Referenced in: [show references]