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

7
LINES

< > BotCompany Repo | #1018649 // reverseComparator

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (48L/1K).

static <A> Comparator<A> reverseComparator(Comparator<A> c) {
  ret (a, b) -> c.compare(b, a);
}

static <A> Comparator<A> reverseComparator() {
  ret (a, b) -> cmp(b, a);
}

Author comment

Began life as a copy of #1006222

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018649
Snippet name: reverseComparator
Eternal ID of this version: #1018649/4
Text MD5: 039d7000dfb054833c7a2047ea53b18a
Transpilation MD5: 421a89a6b82f044ad26bb92033740983
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-26 12:02:21
Source code size: 181 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 404 / 821
Version history: 3 change(s)
Referenced in: [show references]