Libraryless. Click here for Pure Java version (2235L/14K).
1 | static <A> ListEntryWithPrevAndNext<A> listEntryWithPrevAndNext(L<A> l, int idx) {
|
2 | if (idx < 0 || idx >= l(l)) null; |
3 | ret new ListEntryWithPrevAndNext<A>() {
|
4 | public A get() { ret _get(l, idx); }
|
5 | public void set(A a) { l.set(idx, a); }
|
6 | public ListEntryWithPrevAndNext<A> prev() { ret listEntryWithPrevAndNext(l, idx-1); }
|
7 | public ListEntryWithPrevAndNext<A> next() { ret listEntryWithPrevAndNext(l, idx+1); }
|
8 | }; |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1026420 |
| Snippet name: | listEntryWithPrevAndNext |
| Eternal ID of this version: | #1026420/8 |
| Text MD5: | b73cc15785c6de7243211a966669e624 |
| Transpilation MD5: | 357bf190f194aa3c3e8a7108a671faeb |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-01-03 16:58:56 |
| Source code size: | 442 bytes / 9 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 384 / 527 |
| Version history: | 7 change(s) |
| Referenced in: | [show references] |