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

13
LINES

< > BotCompany Repo | #1024257 // mapMultiSetByPopularity - map MultiSet to List

JavaX fragment (include)

1  
static <A, B> L<B> mapMultiSetByPopularity(MultiSet<A> ms, F2<A, Int, B> f) {
2  
  new L<B> l;
3  
  if (ms != null) for (A key : ms.highestFirst())
4  
    l.add(callF(f, key, ms.get(key)));
5  
  ret l;
6  
}
7  
8  
static <A, B> L<B> mapMultiSetByPopularity(MultiSet<A> ms, IF2<A, Int, B> f) {
9  
  new L<B> l;
10  
  if (ms != null) for (A key : ms.highestFirst())
11  
    l.add(callF(f, key, ms.get(key)));
12  
  ret l;
13  
}

Author comment

Began life as a copy of #1015980

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1024257
Snippet name: mapMultiSetByPopularity - map MultiSet to List
Eternal ID of this version: #1024257/1
Text MD5: 03114c7b43d5f7a78dd33f84288b7977
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-28 18:24:36
Source code size: 397 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 164 / 208
Referenced in: [show references]