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

22
LINES

< > BotCompany Repo | #1011278 // Test ArrayTreeMap [OK]

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

Download Jar. Libraryless. Click here for Pure Java version (1996L/14K).

!7

p {
  new Map<Int, S> m;
  for (int n = 0; n <= 1024; n++) {
    if (n != 0) m.put(n*10, str(n*10));
    print("n=" + n); assertEquals(n, l(m));
    ArrayTreeMap<Int, S> map = new ArrayTreeMap(m);
    if (n <= 64) {
      printStruct(map);
      print("first=" + map.first());
    }
    assertEquals(n, l(map));
    for (int i : keys(m)) {
      assertEquals(str(i), map.get(i));
      assertNull(map.get(i-1));
      assertNull(map.get(i+1));
    }
    assertEquals(sorted(keys(m)), asList(keys(map)));
  }
  print("OK");
}

Author comment

Began life as a copy of #1011276

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

-
Snippet ID: #1011278
Snippet name: Test ArrayTreeMap [OK]
Eternal ID of this version: #1011278/9
Text MD5: c0e49e4138be9acdef945532c6dd6dbe
Transpilation MD5: a3f5a61916c5c4dfcd39731335fcc457
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-22 02:14:09
Source code size: 549 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 547 / 1106
Version history: 8 change(s)
Referenced in: