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

4
LINES

< > BotCompany Repo | #1032059 // probabilityComparator - higher probability first

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

Libraryless. Click here for Pure Java version (3442L/19K).

// probably not needed as WithProbability can compare itself
static <A> Comparator<WithProbability<A>> probabilityComparator() {
  ret (a, b) -> cmp(b.probability, a.probability);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032059
Snippet name: probabilityComparator - higher probability first
Eternal ID of this version: #1032059/4
Text MD5: f7ad4b400a3f3abe53a4d442d3d826e6
Transpilation MD5: cc6d62f959095124ee91b2ff4bc79c9c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-11 08:45:25
Source code size: 184 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 141 / 207
Version history: 3 change(s)
Referenced in: [show references]