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

14
LINES

< > BotCompany Repo | #1018022 // mapToCISet - map function, return as CI set

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

Libraryless. Click here for Pure Java version (2559L/16K).

static <A> TreeSet<S> mapToCISet(IF1<A, S> f, Iterable<A> l) {
  ret mapToCISet((O) f, l);
}

static TreeSet<S> mapToCISet(O f, Iterable l) {
  TreeSet<S> x = ciSet();
  if (l != null) for (O o : l)
    addIfNotNull(x, (S) callF(f, o));
  ret x;
}

static <A> TreeSet<S> mapToCISet(Iterable<A> l, IF1<A, S> f) {
  ret mapToCISet(f, l);
}

Author comment

Began life as a copy of #1011181

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018022
Snippet name: mapToCISet - map function, return as CI set
Eternal ID of this version: #1018022/3
Text MD5: 2ff0fbe393d25f9b99c5961cc66e38aa
Transpilation MD5: 996c356ece81c3d17d412d0dbd5ad6ca
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-06 15:59:00
Source code size: 350 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 323 / 402
Version history: 2 change(s)
Referenced in: [show references]