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

13
LINES

< > BotCompany Repo | #1005063 // collectMultiSet

JavaX fragment (include)

static MultiSet collectMultiSet(Collection c, S field) {
  new MultiSet set;
  for (O a : c) {
    O val = getOpt(a, field);
    if (val != null)
      set.add(val);
  }
  ret set;
}

static MultiSet mapMethodLike collectMultiSet(S field, Collection c) {
  ret collectMultiSet(c, field);
}

Author comment

Began life as a copy of #1002504

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005063
Snippet name: collectMultiSet
Eternal ID of this version: #1005063/2
Text MD5: 12176350355decefb602f63d2d794e54
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-12 23:38:41
Source code size: 301 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 555 / 575
Version history: 1 change(s)
Referenced in: #1006019 - charCounts - count characters in string in multiset
#1006654 - Standard functions list 2 (LIVE, continuation of #761)