Examples of MapIS


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

  public void testBasic1() {
    int size = 10000;
    Random r = new Random();
    short[] shorts = new short[size];

    MapIS map = new HMapIS();
    for (int i = 0; i < size; i++) {
      int k = r.nextInt(size);
      map.put(i, (short) (k * 2));
      shorts[i] = (short) (k * 2);
    }

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

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

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

  public void testUpdate() {
    int size = 10000;
    Random r = new Random();
    short[] shorts = new short[size];

    MapIS map = new HMapIS();
    for (int i = 0; i < size; i++) {
      int k = r.nextInt(size);
      map.put(i, (short) (k + 10));
      shorts[i] = (short) (k + 10);
    }

    assertEquals(size, map.size());

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

    assertEquals(size, map.size());

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

      assertEquals(shorts[i] + 10, 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.