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

9
LINES

< > BotCompany Repo | #1032754 // flattenCollections

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

Libraryless. Click here for Pure Java version (34L/1K).

1  
static L flattenCollections(Iterable a) {
2  
  new L l;
3  
  for (O x : a)
4  
    if (x instanceof Cl)
5  
      l.addAll(flattenCollections((Cl) x));
6  
    else
7  
      l.add(x);
8  
  ret l;
9  
}

Author comment

Began life as a copy of #1004447

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1032754
Snippet name: flattenCollections
Eternal ID of this version: #1032754/1
Text MD5: 03f7be015eabeda03102037794137e95
Transpilation MD5: 15ddc470bd4ce15335e712be5367e1bd
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-04 14:47:26
Source code size: 181 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 42 / 91
Referenced in: [show references]