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

13
LINES

< > BotCompany Repo | #1001871 // group function - whatever this does :-D

JavaX fragment (include)

1  
static L group(Class theClass, L<S> fields, L data) {
2  
  new L l;
3  
  for (int i = 0; i < l(data); i += l(fields)) {
4  
    O o = newObject(theClass);
5  
    for (int j = 0; j < min(l(fields), l(data)-i); j++) {
6  
      S field = fields.get(j);
7  
      O item = data.get(i+j);
8  
      setOpt(o, field, item);
9  
    }
10  
    l.add(o);
11  
  }
12  
  ret l;
13  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001871
Snippet name: group function - whatever this does :-D
Eternal ID of this version: #1001871/2
Text MD5: 57501c9e55387480225f2f6e81b5145b
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-23 17:25:41
Source code size: 340 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 660 / 907
Version history: 1 change(s)
Referenced in: [show references]