static final class TArray<A> extends ArrayList<A> { Class<A> type; *() {} *(Class<A> *type) {} <B> TArray<B> cast() { ret (TArray) this; } public bool add(A a) { assertIsInstance(type, a); ret super.add(a); } public A set(int i, A a) { assertIsInstance(type, a); ret super.set(i, a); } // overwrite more methods? }
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1015623 |
Snippet name: | TArray (ArrayList with reified element type) |
Eternal ID of this version: | #1015623/19 |
Text MD5: | d7070cc065330ae7bcd62c618493c1e7 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-06 04:44:22 |
Source code size: | 376 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 439 / 985 |
Version history: | 18 change(s) |
Referenced in: | #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674) |