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

13
LINES

< > BotCompany Repo | #1026439 // cyclicGet

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

Libraryless. Click here for Pure Java version (7507L/42K).

static <A> A cyclicGet(L<A> l, int i) {
  ret empty(l) ? null : get(l, mod(i, l(l)));
}

sbool cyclicGet(BitSet bs, int n, int i) {
  ret bs != null && bs.get(mod(i, n));
}

ifclass LongBuffer
static long cyclicGet(LongBuffer l, int i) {
  ret l.get(mod(i, l.size()));
}
endif

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, elmgxqgtpvxh, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026439
Snippet name: cyclicGet
Eternal ID of this version: #1026439/3
Text MD5: a4fdbfe8b2598b39a500e03200926c0d
Transpilation MD5: a22ecdd6466e84c46702e1f73ed6f6c4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-26 02:57:18
Source code size: 288 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 151 / 245
Version history: 2 change(s)
Referenced in: [show references]