Package java.util

Examples of java.util.IdentityHashMap.values()


    Map map3 = Collections.EMPTY_MAP;
    assertSame("EMPTY_MAP", map3.values(), map3.values());

    AbstractMap map4 = new IdentityHashMap(1);
    assertSame("IdentityHashMap", map4.values(), map4.values());

    AbstractMap map5 = new LinkedHashMap(122);
    assertSame("IdentityHashMap", map5.values(), map5.values());

    AbstractMap map6 = new TreeMap();
View Full Code Here


    Map map3 = Collections.EMPTY_MAP;
    assertSame("EMPTY_MAP", map3.values(), map3.values());

    AbstractMap map4 = new IdentityHashMap(1);
    assertSame("IdentityHashMap", map4.values(), map4.values());

    AbstractMap map5 = new LinkedHashMap(122);
    assertSame("IdentityHashMap", map5.values(), map5.values());

    AbstractMap map6 = new TreeMap();
View Full Code Here

    IdentityHashMap map = new IdentityHashMap();
    map.put("key", "value");
    // get the keySet() and values() on the original Map
    Set keys = map.keySet();
    Collection values = map.values();
    assertEquals("values() does not work",
        "value", values.iterator().next());
    assertEquals("keySet() does not work",
        "key", keys.iterator().next());
    AbstractMap map2 = (AbstractMap) map.clone();
View Full Code Here

          .contains(objArray[i]));

    IdentityHashMap myIdentityHashMap = new IdentityHashMap();
    for (int i = 0; i < 100; i++)
      myIdentityHashMap.put(objArray2[i], objArray[i]);
    Collection values = myIdentityHashMap.values();
    values.remove(objArray[0]);
    assertTrue(
        "Removing from the values collection should remove from the original map",
        !myIdentityHashMap.containsValue(objArray2[0]));
View Full Code Here

    Map map3 = Collections.EMPTY_MAP;
    assertSame("EMPTY_MAP", map3.values(), map3.values());

    AbstractMap map4 = new IdentityHashMap(1);
    assertSame("IdentityHashMap", map4.values(), map4.values());

    AbstractMap map5 = new LinkedHashMap(122);
    assertSame("IdentityHashMap", map5.values(), map5.values());

    AbstractMap map6 = new TreeMap();
View Full Code Here

    Map map3 = Collections.EMPTY_MAP;
    assertSame("EMPTY_MAP", map3.values(), map3.values());

    AbstractMap map4 = new IdentityHashMap(1);
    assertSame("IdentityHashMap", map4.values(), map4.values());

    AbstractMap map5 = new LinkedHashMap(122);
    assertSame("IdentityHashMap", map5.values(), map5.values());

    AbstractMap map6 = new TreeMap();
View Full Code Here

    IdentityHashMap hashMap = new IdentityHashMap(srcMap);
    assertFalse(hashMap.isEmpty());
    assertTrue(hashMap.size() == SIZE_THREE);

    Collection valColl = hashMap.values();
    assertTrue(valColl.contains(INTEGER_11));
    assertTrue(valColl.contains(INTEGER_22));
    assertTrue(valColl.contains(INTEGER_33));

    Collection keyColl = hashMap.keySet();
View Full Code Here

   */
  public void testValues() {
    IdentityHashMap hashMap = new IdentityHashMap();
    checkEmptyHashMapAssumptions(hashMap);

    assertNotNull(hashMap.values());

    hashMap.put(KEY_KEY, VALUE_VAL);

    Collection valColl = hashMap.values();
    assertNotNull(valColl);
View Full Code Here

    assertNotNull(hashMap.values());

    hashMap.put(KEY_KEY, VALUE_VAL);

    Collection valColl = hashMap.values();
    assertNotNull(valColl);
    assertEquals(valColl.size(), SIZE_ONE);

    Iterator itVal = valColl.iterator();
    String val = (String) itVal.next();
View Full Code Here

        Map map3 = Collections.EMPTY_MAP;
        assertSame("EMPTY_MAP", map3.values(), map3.values());

        AbstractMap map4 = new IdentityHashMap(1);
        assertSame("IdentityHashMap", map4.values(), map4.values());

        AbstractMap map5 = new LinkedHashMap(122);
        assertSame("IdentityHashMap", map5.values(), map5.values());

        AbstractMap map6 = new TreeMap();
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.