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

5
LINES

< > BotCompany Repo | #1036522 // pairGet

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

Libraryless. Click here for Pure Java version (10048L/55K).

static <A> A pairGet(Pair<A> p, int idx) {
  if (idx == 0) ret p.a;
  if (idx == 1) ret p.b;
  fail("Index out of range for pair", idx);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036522
Snippet name: pairGet
Eternal ID of this version: #1036522/2
Text MD5: 1bfc83be44f24d93cb385e1f66f70b78
Transpilation MD5: bff395e897076daf44d5c290f1309a50
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:13:54
Source code size: 142 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 155 / 206
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)