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).

1  
static <A> A cyclicGet(L<A> l, int i) {
2  
  ret empty(l) ? null : get(l, mod(i, l(l)));
3  
}
4  
5  
sbool cyclicGet(BitSet bs, int n, int i) {
6  
  ret bs != null && bs.get(mod(i, n));
7  
}
8  
9  
ifclass LongBuffer
10  
static long cyclicGet(LongBuffer l, int i) {
11  
  ret l.get(mod(i, l.size()));
12  
}
13  
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: 154 / 251
Version history: 2 change(s)
Referenced in: [show references]