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

7
LINES

< > BotCompany Repo | #1036521 // SameTypePair - Pair where both types are identical. Not sure if we should use this. Use pairGet instead

JavaX fragment (include)

sclass SameTypePair<A> extends Pair<A> {
  A get(int i) {
    if (i == 0) ret a;
    if (i == 1) ret b;
    fail("Index out of range", i);
  }
}

Author comment

Began life as a copy of #1004219

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036521
Snippet name: SameTypePair - Pair where both types are identical. Not sure if we should use this. Use pairGet instead
Eternal ID of this version: #1036521/5
Text MD5: 57f7472992def7ef4e4278d66fbebe59
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-01-22 12:14:13
Source code size: 150 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 145 / 154
Version history: 4 change(s)
Referenced in: [show references]