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

7
LINES

< > BotCompany Repo | #1028174 // multiSetComparatorDesc - highest count first

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

Libraryless. Click here for Pure Java version (2993L/18K).

static <A> Comparator<A> multiSetComparatorDesc(MultiSet<A> ms) {
  ret ms == null ? null : new Comparator<A>() {
    public int compare(A a, A b) {
      return cmp(ms.get(b), ms.get(a));
    }
  };
}

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: #1028174
Snippet name: multiSetComparatorDesc - highest count first
Eternal ID of this version: #1028174/2
Text MD5: f18e8ac7094507be4feffb4b340ab3ff
Transpilation MD5: ecbaa0e9116b5ae1f28fb903d1f863ec
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-25 13:43:51
Source code size: 207 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 173 / 255
Version history: 1 change(s)
Referenced in: [show references]