ecologylab.generic
Class HashMapWriteSynch2Args<K,V,A>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by ecologylab.generic.HashMapWriteSynchBase<K,V>
              extended by ecologylab.generic.HashMapWriteSynch2Args<K,V,A>
Type Parameters:
K -
V -
A - 2nd argument to value constructor
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<K,V>

public class HashMapWriteSynch2Args<K,V,A>
extends HashMapWriteSynchBase<K,V>

Hashed data structure with synchronized writes/deletes and unsynchronized reads. Constructor takes 2 args. First one is the key.

Author:
andruid, robinson
See Also:
Serialized Form

Constructor Summary
HashMapWriteSynch2Args()
           
HashMapWriteSynch2Args(int arg0)
           
HashMapWriteSynch2Args(int arg0, float arg1)
           
HashMapWriteSynch2Args(java.util.Map arg0)
           
 
Method Summary
 V getOrCreateAndPutIfNew(K key, A arg, ValueFactory2<K,V,A> factory)
          If there is already an entry, return it.
 
Methods inherited from class ecologylab.generic.HashMapWriteSynchBase
getOrPutIfNew, putAll, remove
 
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
 

Constructor Detail

HashMapWriteSynch2Args

public HashMapWriteSynch2Args(int arg0,
                              float arg1)
Parameters:
arg0 -
arg1 -

HashMapWriteSynch2Args

public HashMapWriteSynch2Args(int arg0)
Parameters:
arg0 -

HashMapWriteSynch2Args

public HashMapWriteSynch2Args()

HashMapWriteSynch2Args

public HashMapWriteSynch2Args(java.util.Map arg0)
Parameters:
arg0 -
Method Detail

getOrCreateAndPutIfNew

public V getOrCreateAndPutIfNew(K key,
                                A arg,
                                ValueFactory2<K,V,A> factory)
If there is already an entry, return it. Otherwise, create an entry with the factory.

Returns:
The entry matching key, found or constructed.