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

10
LINES

< > BotCompany Repo | #1011789 // subListOfCollection

JavaX fragment (include)

static <A> L<A> subListOfCollection(Collection<A> c, int from, int to) {
  int n = l(c);
  to = min(to, n);
  if (from >= n || to <= from) ret ll();
  L<A> l = new L(to-from);
  Iterator<A> it = iterator(c);
  repeat from { it.next(); }
  while (from++ < to) l.add(it.next());
  ret l;
}

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: #1011789
Snippet name: subListOfCollection
Eternal ID of this version: #1011789/1
Text MD5: 1eb58fa8098f5ab21e6d7964bc76fb7e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-05 05:41:45
Source code size: 296 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 337 / 387
Referenced in: [show references]