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

15
LINES

< > BotCompany Repo | #1006772 // mapMethod - call same method on each object

JavaX fragment (include)

1  
static L mapMethod(O[] l, fS methodName) {
2  
  ret map(l, func(O o) { callOpt(o, methodName) });
3  
}
4  
5  
static L mapMethod(Iterable c, fS methodName) {
6  
  ret map(c, func(O o) { callOpt(o, methodName) });
7  
}
8  
9  
static L mapMethod(S methodName, Iterable c) {
10  
  ret mapMethod(c, methodName);
11  
}
12  
13  
static L mapMethod(S methodName, Enumeration c) {
14  
  ret mapMethod(methodName, enumerationToIterator(c));
15  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006772
Snippet name: mapMethod - call same method on each object
Eternal ID of this version: #1006772/6
Text MD5: e8b0844e032b96e14cfcc53a2761f7f8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-03 00:32:40
Source code size: 403 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 540 / 590
Version history: 5 change(s)
Referenced in: [show references]