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

6
LINES

< > BotCompany Repo | #1029040 // wrapIntArrayAsImmutableList_ofs - add a value to each element

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

Libraryless. Click here for Pure Java version (2420L/16K).

static L<Int> wrapIntArrayAsImmutableList_ofs(int[] l, int ofs) {
  ret new RandomAccessAbstractList<Int>() {
    public int size() { ret l.length; }
    public Int get(int i) { ret l[i]+ofs; }
  };
}

Author comment

Began life as a copy of #1028512

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1029040
Snippet name: wrapIntArrayAsImmutableList_ofs - add a value to each element
Eternal ID of this version: #1029040/1
Text MD5: 7f7e30740811568a9782b8fb77324bf5
Transpilation MD5: e6e761bd37cfa8d653de7577ff0542ca
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-17 14:03:41
Source code size: 205 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 123 / 193
Referenced in: [show references]