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: 780 / 4799
Version history: 1 change(s)
Referenced in: [show references]