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

13
LINES

< > BotCompany Repo | #1030106 // renderMultiSetAsLines_byPopularity

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

Transpiled version (3422L) is out of date.

1  
sS renderMultiSetAsLines_byPopularity(MultiSet ms, O... _) {
2  
  optPar int padWidth = 6;
3  
  optPar S connector = ": ";
4  
  if (ms == null) ret "-";
5  
  new LS l;
6  
  for (O o : ms.highestFirst())
7  
    l.add(lpad(padWidth, n2(ms.get(o))) + connector + str(o));
8  
  ret lines(l);
9  
}
10  
11  
static <A> S renderMultiSetAsLines_byPopularity(Iterable<A> l, O... _) {
12  
  ret renderMultiSetAsLines_byPopularity(toMultiSet(l), _);
13  
}

Author comment

Began life as a copy of #1030104

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030106
Snippet name: renderMultiSetAsLines_byPopularity
Eternal ID of this version: #1030106/6
Text MD5: d420a7e2dfd4c1ce1b20e4c851e8c2b7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-21 07:36:00
Source code size: 416 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 213 / 313
Version history: 5 change(s)
Referenced in: [show references]