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

8
LINES

< > BotCompany Repo | #1033491 // multiSetDuplicatesOnly - in original order

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

Libraryless. Click here for Pure Java version (5087L/28K).

1  
static <A> MultiSet<A> multiSetDuplicatesOnly(MultiSet<A> ms) {
2  
  if (ms == null) null;
3  
  MultiSet<A> ms2 = similarEmptyMultiSet(ms);
4  
  for (A a, int count : ms.asMap())
5  
    if (count > 1)
6  
      ms2.put(a, count);
7  
  ret ms2;
8  
}

Author comment

Began life as a copy of #1028770

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033491
Snippet name: multiSetDuplicatesOnly - in original order
Eternal ID of this version: #1033491/3
Text MD5: 5c63daf53bcf176deb1d2248dc5317b7
Transpilation MD5: 8149859a93325af323486c451387ecab
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-29 06:15:37
Source code size: 233 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 137 / 199
Version history: 2 change(s)
Referenced in: [show references]