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

6
LINES

< > BotCompany Repo | #1035212 // virtualNullList - list consisting only of nulls

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

Libraryless. Click here for Pure Java version (38L/1K).

static <A> L<A> virtualNullList(int n) {
  ret new RandomAccessAbstractList<A>() {
    public int size() { ret n; }
    public A get(int i) { null; }
  };
}

Author comment

Began life as a copy of #1033229

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035212
Snippet name: virtualNullList - list consisting only of nulls
Eternal ID of this version: #1035212/1
Text MD5: 989a3567041d64456723952a604f7c85
Transpilation MD5: 73487a5229ba07e475be6064ea1f98f4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-15 17:02:35
Source code size: 161 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 54 / 82
Referenced in: [show references]