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

16
LINES

< > BotCompany Repo | #1001235 // toStringArray

JavaX fragment (include)

static S[] toStringArray(Collection<S> c) {
  S[] a = new S[l(c)];
  Iterator<S> it = c.iterator();
  for (int i = 0; i < l(a); i++)
    a[i] = it.next();
  ret a;
}

static S[] toStringArray(O o) {
  if (o instanceof S[])
    return (S[]) o;
  else if (o instanceof Collection)
    return toStringArray((Collection<S>) o);
  else
    throw fail("Not a collection or array: " + getClassName(o));
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001235
Snippet name: toStringArray
Eternal ID of this version: #1001235/2
Text MD5: 5886166aed044c1ac946f978a429f0fb
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-15 03:20:18
Source code size: 414 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 782 / 4801
Version history: 1 change(s)
Referenced in: #1001370 - x28.java (JavaX)
#1001600 - x29.java (JavaX)
#1002013 - toObjectArray - could make optimized version for non-concurrent collections
#1002427 - Accellerating 629 (SPIKE)
#1004305 - x31.java (JavaX)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1006869 - asStringArray - synonym of toStringArray
#1012695 - toSymbolArray
#1024548 - asComponentArray
#3000382 - Answer for ferdie (>> t = 1, f = 0)