ecologylab.generic
Class HashMapWriteSynch<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
ecologylab.generic.HashMapWriteSynchBase<K,V>
ecologylab.generic.HashMapWriteSynch<K,V>
- Type Parameters:
K - V -
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.Map<K,V>
- Direct Known Subclasses:
- HashMapFromStringsWriteSynch
public class HashMapWriteSynch<K,V>
- extends HashMapWriteSynchBase<K,V>
Hashed data structure with synchronized writes/deletes and unsynchronized reads.
- Author:
- andruid, robinson
- See Also:
- Serialized Form
| Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, size, values |
| Methods inherited from class java.util.AbstractMap |
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 |
HashMapWriteSynch
public HashMapWriteSynch(int arg0,
float arg1)
HashMapWriteSynch
public HashMapWriteSynch(int arg0)
HashMapWriteSynch
public HashMapWriteSynch()
HashMapWriteSynch
public HashMapWriteSynch(java.util.Map<? extends K,? extends V> arg0)
getOrPutIfNew
public V getOrPutIfNew(K key,
V value)
- If there is already an entry, return it.
Otherwise, add the entry, and return null.
NB: NEVER replaces an existing entry.
- Overrides:
getOrPutIfNew in class HashMapWriteSynchBase<K,V>
getOrCreateAndPutIfNew
public V getOrCreateAndPutIfNew(K key,
ValueFactory<K,V> factory)
- If there is already an entry, return it.
Otherwise, create an entry with the factory.
- Returns:
- The entry matching key, found or constructed.