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

10
LINES

< > BotCompany Repo | #1021693 // printMultiSet - print MultiSet in order of prevalence (uses toString)

JavaX fragment (include)

static void printMultiSet(MultiSet ms) {
  printMultiSet(ms, null);
}

// renderer = func(O) -> S
static void printMultiSet(MultiSet ms, O renderer) {
  for (O o : ms.highestFirst())
    print(ms.get(o) + ": " + (renderer != null ? callF(renderer, o) : str(o)));
  print();
}

Author comment

Began life as a copy of #1003757

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1021693
Snippet name: printMultiSet - print MultiSet in order of prevalence (uses toString)
Eternal ID of this version: #1021693/3
Text MD5: b9a6cab12740298ab13c53903910585b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-24 15:24:02
Source code size: 286 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 245 / 259
Version history: 2 change(s)
Referenced in: [show references]