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

10
LINES

< > BotCompany Repo | #1031984 // getOr

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

Transpiled version (2978L) is out of date.

static <A> A getOr(L<A> l, int i, A defaultValue) {
  ret or(get(l, i), defaultValue);
}

ifclass DoubleBuffer
static double getOr(DoubleBuffer l, int i, double defaultValue) {
  if (i >= 0 && i < l(l)) ret l.get(i);
  ret defaultValue;
}
endif

Author comment

Began life as a copy of #1029271

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031984
Snippet name: getOr
Eternal ID of this version: #1031984/4
Text MD5: e0f7998e4081ef0c128103de322e8318
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-17 15:12:22
Source code size: 253 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 103 / 159
Version history: 3 change(s)
Referenced in: [show references]