Libraryless. Click here for Pure Java version (5310L/29K).
1 | persistable sclass ListToMatrix<A> extends AbstractMatrix<A> { |
2 | L<A> data; |
3 | |
4 | *(int w, int h, L<A> *data) { super(w, h); } |
5 | |
6 | int xyToIndex(int x, int y) { |
7 | ret y*w+x; |
8 | } |
9 | |
10 | public A get(int x, int y) { ret data.get(xyToIndex(x, y)); } |
11 | public void set(int x, int y, A a) { data.set(xyToIndex(x, y), a); } |
12 | } |
Began life as a copy of #1033239
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033379 |
Snippet name: | ListToMatrix |
Eternal ID of this version: | #1033379/4 |
Text MD5: | ab003d124a1a5434df8cdf80264869e1 |
Transpilation MD5: | 12de2dab6b483e16ec8ebbb59dab95c7 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-27 00:04:43 |
Source code size: | 328 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 192 / 270 |
Version history: | 3 change(s) |
Referenced in: | [show references] |