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).

1  
static LinkedList mapToLinkedList(Iterable l, O f) {
2  
  new LinkedList x;
3  
  if (l != null) for (O o : l)
4  
    x.add(callF(f, o));
5  
  ret x;
6  
}
7  
8  
static <A, B> LinkedList<B> mapToLinkedList(Iterable<A> l, IF1<A, B> f) {
9  
  ret mapToLinkedList(l, (O) f);
10  
}

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: 176 / 266
Version history: 5 change(s)
Referenced in: [show references]