org.apache.uima.util
Class ConcurrentHashMapWithProducer<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<K,V>
org.apache.uima.util.ConcurrentHashMapWithProducer<K,V>
- All Implemented Interfaces:
- java.io.Serializable, java.util.concurrent.ConcurrentMap<K,V>, java.util.Map<K,V>
public class ConcurrentHashMapWithProducer<K,V>
- extends java.util.concurrent.ConcurrentHashMap<K,V>
A concurrent map supporting a value-creating get.
There's a small window where the value producing function could be called multiple times
on different threads, but the first one will be used and the others thrown away.
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class java.util.AbstractMap |
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
Method Summary |
V |
get(K key,
java.util.concurrent.Callable<V> valueProducer)
|
Methods inherited from class java.util.concurrent.ConcurrentHashMap |
clear, contains, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values |
Methods inherited from class java.util.AbstractMap |
clone, equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
ConcurrentHashMapWithProducer
public ConcurrentHashMapWithProducer()
ConcurrentHashMapWithProducer
public ConcurrentHashMapWithProducer(int initialCapacity,
float loadFactor,
int concurrencyLevel)
ConcurrentHashMapWithProducer
public ConcurrentHashMapWithProducer(int initialCapacity,
float loadFactor)
ConcurrentHashMapWithProducer
public ConcurrentHashMapWithProducer(int initialCapacity)
ConcurrentHashMapWithProducer
public ConcurrentHashMapWithProducer(java.util.Map<? extends K,? extends V> m)
get
public V get(K key,
java.util.concurrent.Callable<V> valueProducer)
throws java.lang.Exception
- Throws:
java.lang.Exception
Copyright © 2006–2014 The Apache Software Foundation. All rights reserved.