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

11
LINES

< > BotCompany Repo | #1019752 // intRangeList - from a to b-1

JavaX fragment (include)

static L<Int> intRangeList(int b) {
  ret intRangeList(0, b);
}

static L<Int> intRangeList(final int a, final int b) {
  final int l = max(0, b-a);
  ret RandomAccessAbstractList<Int>() {
    public int size() { ret l; }
    public Int get(int i) { ret i >= 0 && i < l ? a+i : null; }
  };
}

Author comment

Began life as a copy of #1019750

download  show line numbers  debug dex  old transpilations   

Travelled to 10 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019752
Snippet name: intRangeList - from a to b-1
Eternal ID of this version: #1019752/5
Text MD5: a3c33db2a03032436ede76d0c54b227c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-31 01:17:42
Source code size: 302 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 213 / 283
Version history: 4 change(s)
Referenced in: [show references]