Examples of MapIL


Examples of edu.umd.cloud9.util.map.MapIL

  public void testBasic1() {
    int size = 100000;
    Random r = new Random();
    long[] longs = new long[size];

    MapIL map = new HMapIL();
    for (int i = 0; i < size; i++) {
      int k = r.nextInt(size);
      map.put(i, k * 2);
      longs[i] = k * 2;
    }

    for (int i = 0; i < size; i++) {
      long v = map.get(i);

      assertEquals(longs[i], v);
      assertTrue(map.containsKey(i));
    }
  }
View Full Code Here

Examples of edu.umd.cloud9.util.map.MapIL

  public void testUpdate() {
    int size = 100000;
    Random r = new Random();
    long[] longs = new long[size];

    MapIL map = new HMapIL();
    for (int i = 0; i < size; i++) {
      int k = r.nextInt(size);
      map.put(i, k + 10L);
      longs[i] = k + 10L;
    }

    assertEquals(size, map.size());

    for (int i = 0; i < size; i++) {
      map.put(i, longs[i] + 10L);
    }

    assertEquals(size, map.size());

    for (int i = 0; i < size; i++) {
      long v = map.get(i);

      assertEquals(longs[i] + 10L, v);
      assertTrue(map.containsKey(i));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.