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

10
LINES

< > BotCompany Repo | #1025703 // listGetOrCreate_full - init all missing entries

JavaX fragment (include)

static <A> A listGetOrCreate_full(L<A> l, int i, Class<? extends A> c) {
  if (l == null) null;
  while (i >= l(l))
    l.add(nuInstance(c));
  ret l.get(i);
}

static <A> A nuLike listGetOrCreate_full(Class<? extends A> c, L<A> l, int i) {
  ret listGetOrCreate_full(l, i, c);
}

Author comment

Began life as a copy of #1022705

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025703
Snippet name: listGetOrCreate_full - init all missing entries
Eternal ID of this version: #1025703/1
Text MD5: c02d8868997b7ad4dab3a9f1b67a04e8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-13 23:45:47
Source code size: 288 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 122 / 165
Referenced in: [show references]