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

11
LINES

< > BotCompany Repo | #1010496 // renderMultiSet

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

Libraryless. Click here for Pure Java version (3732L/22K).

static S renderMultiSet(MultiSet ms) {
  if (ms == null) ret "-";
  new L<S> l;
  for (O o : ms.highestFirst())
    l.add(str(o) + " (" + ms.get(o) + ")");
  ret joinWithComma(l);
}

static <A> S renderMultiSet(Iterable<A> l) {
  ret renderMultiSet(toMultiSet(l));
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010496
Snippet name: renderMultiSet
Eternal ID of this version: #1010496/4
Text MD5: e8fc6f6876c1af67b17a2a9a6bd8f6ab
Transpilation MD5: d9cafc71426dcc1746361f5b70d22da4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-29 03:38:40
Source code size: 276 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 432 / 476
Version history: 3 change(s)
Referenced in: [show references]