Libraryless. Click here for Pure Java version (3914L/23K).
1 | srecord Channels<A>(A[] data) { |
2 | *(int n) { data = newGenericArray(n); } |
3 | |
4 | int channels() { ret l(data); } |
5 | |
6 | A get(int channel) { ret data[channel]; } |
7 | |
8 | void set(int channel, A a) { data[channel] = a; } |
9 | |
10 | A first() { ret main first(data); } |
11 | A getSingleton() { assertEquals(1, channels()); ret first(); } |
12 | |
13 | toString { ret "Channels[" + joinWithComma(data) + "]"; } |
14 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032989 |
Snippet name: | Channels |
Eternal ID of this version: | #1032989/11 |
Text MD5: | 7babefec4c43c5acc60e3b14704b32f5 |
Transpilation MD5: | c5e9d85bc038711dd0e839f32d4c1361 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-18 05:03:48 |
Source code size: | 396 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 231 / 379 |
Version history: | 10 change(s) |
Referenced in: | [show references] |