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

16
LINES

< > BotCompany Repo | #1031609 // mapToLinkedHashSet - map function, return as LinkedHashSet

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

Libraryless. Click here for Pure Java version (7885L/44K).

static LinkedHashSet mapToLinkedHashSet(O f, Cl l) {
  LinkedHashSet x = new(l(l));
  if (l != null) for (O o : l)
    x.add(callF(f, o));
  ret x;
}
static LinkedHashSet mapToLinkedHashSet(O f, Iterable l) {
  new LinkedHashSet x;
  if (l != null) for (O o : l)
    x.add(callF(f, o));
  ret x;
}

static <A, B> LinkedHashSet<B> lambdaMapLike mapToLinkedHashSet(IF1<A, B> f, Iterable<A> l) {
  ret mapToLinkedHashSet((O) f, l);
}

Author comment

Began life as a copy of #1011181

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031609
Snippet name: mapToLinkedHashSet - map function, return as LinkedHashSet
Eternal ID of this version: #1031609/4
Text MD5: 27816050f8be692e0211be1f32d70354
Transpilation MD5: 7dc9232a7542aae3d0c97c8637d03a65
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-06 15:40:14
Source code size: 445 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 98 / 158
Version history: 3 change(s)
Referenced in: [show references]