Libraryless. Click here for Pure Java version (3914L/23K).
srecord Channels<A>(A[] data) { *(int n) { data = newGenericArray(n); } int channels() { ret l(data); } A get(int channel) { ret data[channel]; } void set(int channel, A a) { data[channel] = a; } A first() { ret main first(data); } A getSingleton() { assertEquals(1, channels()); ret first(); } toString { ret "Channels[" + joinWithComma(data) + "]"; } }
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: | 230 / 378 |
Version history: | 10 change(s) |
Referenced in: | #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674) |