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

10
LINES

< > BotCompany Repo | #1013644 // multiSetTopTenAsLinkedHashMap

JavaX fragment (include)

1  
static <A> LinkedHashMap<A, Int> multiSetTopTenAsLinkedHashMap(MultiSet<A> ms) {
2  
  ret multiSetTopTenAsLinkedHashMap(ms, 10);
3  
}
4  
5  
static <A> LinkedHashMap<A, Int> multiSetTopTenAsLinkedHashMap(MultiSet<A> ms, int n) {
6  
  new LinkedHashMap<A, Int> map;
7  
  for (A a : ms.getTopTen(n))
8  
    map.put(a, ms.get(a));
9  
  ret map;
10  
}

Author comment

Began life as a copy of #1013507

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1013644
Snippet name: multiSetTopTenAsLinkedHashMap
Eternal ID of this version: #1013644/1
Text MD5: a942dd19a087156440d91d1aba2fd5c0
Author: stefan
Category: javax / collections
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-12 12:33:28
Source code size: 328 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 516 / 471
Referenced in: [show references]