Package edu.stanford.ppl.concurrent

Examples of edu.stanford.ppl.concurrent.SnapTreeMap.containsValue()


    /**
     *  containsValue returns true for held values
     */
    public void testContainsValue() {
        SnapTreeMap map = map5();
        assertTrue(map.containsValue("A"));
        assertFalse(map.containsValue("Z"));
    }

    /**
     *  get returns the correct element at the given key,
View Full Code Here


     *  containsValue returns true for held values
     */
    public void testContainsValue() {
        SnapTreeMap map = map5();
        assertTrue(map.containsValue("A"));
        assertFalse(map.containsValue("Z"));
    }

    /**
     *  get returns the correct element at the given key,
     *  or null if not present
View Full Code Here

        Set s = map.entrySet();
        Object[] ar = s.toArray();
        assertEquals(5, ar.length);
        for (int i = 0; i < 5; ++i) {
            assertTrue(map.containsKey(((Map.Entry)(ar[i])).getKey()));
            assertTrue(map.containsValue(((Map.Entry)(ar[i])).getValue()));
        }
    }

    /**
     *  descendingEntrySet.toArray contains all entries
View Full Code Here

        Set s = map.descendingMap().entrySet();
        Object[] ar = s.toArray();
        assertEquals(5, ar.length);
        for (int i = 0; i < 5; ++i) {
            assertTrue(map.containsKey(((Map.Entry)(ar[i])).getKey()));
            assertTrue(map.containsValue(((Map.Entry)(ar[i])).getValue()));
        }
    }

    /**
     *   putAll  adds all key-value pairs from the given map
View Full Code Here

     * containsValue(null) throws NPE
     */
    public void testContainsValue_NullPointerException() {
        try {
            SnapTreeMap c = new SnapTreeMap();
            c.containsValue(null);
            shouldThrow();
        } catch (NullPointerException success) {}
    }


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.