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)

static void sortByIndex(L<L> l, final int index) {
  sort(l, new Comparator<L>() {
    public int compare(L a, L b) {
      ret cmp(a.get(index), b.get(index));
    }
  });
}

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: 711 / 914
Version history: 3 change(s)
Referenced in: #1001850 - sortFilesByName
#1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1018540 - sortByIndex2 - different typing
#3000382 - Answer for ferdie (>> t = 1, f = 0)