Java Code Examples for java.util.concurrent.ConcurrentHashMap#containsValue()

The following examples show how to use java.util.concurrent.ConcurrentHashMap#containsValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DelayedHashMap.java    From jstarcraft-core with Apache License 2.0 5 votes vote down vote up
@Override
public boolean containsValue(Object value) {
    for (ConcurrentHashMap<K, V> segment : segments) {
        if (segment.containsValue(value)) {
            return true;
        }
    }
    return false;
}
 
Example 2
Source File: ConcurrentHashMapTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * containsValue(null) throws NPE
 */
public void testContainsValue_NullPointerException() {
    ConcurrentHashMap c = new ConcurrentHashMap(5);
    try {
        c.containsValue(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 3
Source File: ConcurrentHashMapTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * containsValue(null) throws NPE
 */
public void testContainsValue_NullPointerException() {
    ConcurrentHashMap c = new ConcurrentHashMap(5);
    try {
        c.containsValue(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}