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

10
LINES

< > BotCompany Repo | #1025601 // mapToLinkedList - map function, return as LinkedList

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

Libraryless. Click here for Pure Java version (2138L/14K).

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

static <A, B> LinkedList<B> mapToLinkedList(Iterable<A> l, IF1<A, B> f) {
  ret mapToLinkedList(l, (O) f);
}

Author comment

Began life as a copy of #1018022

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025601
Snippet name: mapToLinkedList - map function, return as LinkedList
Eternal ID of this version: #1025601/6
Text MD5: bc93be41309b541e3992c40929456529
Transpilation MD5: 720ad3974530b97356356326b9ba151f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-07 14:05:25
Source code size: 257 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 253 / 368
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)