Package org.apache.lucene.util.collections

Examples of org.apache.lucene.util.collections.IntToIntMap.containsKey()


      assertNotNull(map.get(i));
    }

    assertEquals(100, map.size());
    for (int i = 0; i < 100; ++i) {
      assertTrue(map.containsKey(i));
      assertEquals(100 + i, map.get(i));

    }

    for (int i = 10; i < 90; ++i) {
View Full Code Here


      assertGround(map.get(i));
    }

    assertEquals(20, map.size());
    for (int i = 0; i < 100; ++i) {
      assertEquals(map.containsKey(i), !(i >= 10 && i < 90));
    }

    for (int i = 5; i < 85; ++i) {
      map.put(i, Integer.valueOf(5 + i));
    }
View Full Code Here

    for (int i = 5; i < 85; ++i) {
      map.put(i, Integer.valueOf(5 + i));
    }
    assertEquals(95, map.size());
    for (int i = 0; i < 100; ++i) {
      assertEquals(map.containsKey(i), !(i >= 85 && i < 90));
    }
    for (int i = 0; i < 5; ++i) {
      assertEquals(map.get(i), (100 + i));
    }
    for (int i = 5; i < 85; ++i) {
View Full Code Here

      assertFalse(map.isEmpty());
    }

    assertEquals(128, map.size());
    for (int i = 0; i < 128; ++i) {
      assertTrue(map.containsKey(i));
      assertEquals(i * 4096, map.get(i));
    }
   
    for (int i = 0 ; i < 200; i+=2) {
      map.remove(i);
View Full Code Here

    for (int i = 0 ; i < 200; i+=2) {
      map.remove(i);
    }
    assertEquals(64, map.size());
    for (int i = 1; i < 128; i+=2) {
      assertTrue(map.containsKey(i));
      assertEquals(i * 4096, map.get(i));
      map.remove(i);
    }
    assertTrue(map.isEmpty());
  }
View Full Code Here

      assertTrue(valueSet.contains(array3[i]));
    }
   
    for (int i = 0; i < length; ++i) {
      assertTrue(map.containsValue(i + 100));
      assertTrue(map.containsKey(i*64));
    }
   
    for (IntIterator iit = map.keyIterator(); iit.hasNext(); ) {
      iit.next();
      iit.remove();
View Full Code Here

    for (int i = 0; i < length; ++i) {
      int value = random.nextInt(Integer.MAX_VALUE);
     
      assertTrue(map.containsValue(value));
      assertTrue(map.containsKey(i*128));
      assertEquals(value, map.remove(i*128));
    }
    assertEquals(0, map.size());
    assertTrue(map.isEmpty());
  }
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.