Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > BotCompany Repo | #1018569 // Test TArray (typed array, OK)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (6175L/44K).

!7

p-exp {
  final TArray<O> a = widen(TArray(S));
  print("Size of empty TArray: " + exclusive_measureSizeOfObject(func { new TArray(S) }));
  print("Size of empty ArrayList: " + exclusive_measureSizeOfObject(func { new L }));
  printObjectLayout(a);
  
  a.add("hello");
  assertTrue(a.contains("hello"));
  assertEquals("hello", a.get(0));
  assertEquals(1, l(a));
  assertException(r { a.add(5); });
  assertException(r { a.add(null); }); // not allowed either
  a.remove(0);
  assertEquals(0, l(a));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018569
Snippet name: Test TArray (typed array, OK)
Eternal ID of this version: #1018569/11
Text MD5: 076c30d5900ddd4c00d77674705d5b5b
Transpilation MD5: e4de36c669fdaa41c78166d9acae115f
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-06 04:47:28
Source code size: 523 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 295 / 813
Version history: 10 change(s)
Referenced in: [show references]