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

3
LINES

< > BotCompany Repo | #1027807 // compareWithComparator (accepts null comparator)

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

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

1  
static <A> int compareWithComparator(Comparator<A> comparator, A a, A b) {
2  
  ret comparator == null ? cmp(a, b) : comparator.compare(a, b);
3  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027807
Snippet name: compareWithComparator (accepts null comparator)
Eternal ID of this version: #1027807/1
Text MD5: f56693511ded548be3e798cc75538dac
Transpilation MD5: 5289db4c7eeeb6a361e47cf6cfac4fdf
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-13 17:30:07
Source code size: 143 bytes / 3 lines
Pitched / IR pitched: No / No
Views / Downloads: 178 / 262
Referenced in: [show references]