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

12
LINES

< > BotCompany Repo | #1016436 // multiSetToLines

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

Transpiled version (3900L) is out of date.

sS multiSetToLines(MultiSet ms, int max default Int.MAX_VALUE) {
  new LS l;
  if (ms != null) for (O o: ms.highestFirst()) {
    if (l(l) >= max) break;
      l.add(n2(ms.get(o)) + ": " + str(o));
  }
  ret lines(l);
}

static S multiSetToLines(Iterable l, int max default Int.MAX_VALUE) {
  ret multiSetToLines(toMultiSet(l), max);
}

Author comment

Began life as a copy of #1010496

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016436
Snippet name: multiSetToLines
Eternal ID of this version: #1016436/5
Text MD5: 31d1a976ee1c569fadccb786b341c3e9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-29 06:52:26
Source code size: 346 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 343 / 412
Version history: 4 change(s)
Referenced in: [show references]