org.apache.openjpa.lib.util.concurrent
Class SizedConcurrentHashMap
java.lang.Object
   java.util.AbstractMap<K,V>
java.util.AbstractMap<K,V>
       java.util.concurrent.ConcurrentHashMap
java.util.concurrent.ConcurrentHashMap
           org.apache.openjpa.lib.util.concurrent.NullSafeConcurrentHashMap
org.apache.openjpa.lib.util.concurrent.NullSafeConcurrentHashMap
               org.apache.openjpa.lib.util.concurrent.SizedConcurrentHashMap
org.apache.openjpa.lib.util.concurrent.SizedConcurrentHashMap
- All Implemented Interfaces: 
- Serializable, ConcurrentMap, Map, SizedMap
- public class SizedConcurrentHashMap 
- extends NullSafeConcurrentHashMap- implements SizedMap, ConcurrentMap, Serializable
An implementation of SizedMap that uses JDK1.5 concurrency primitives
- Since:
- 1.1.0
- See Also:
- Serialized Form
 
 
 
| Nested classes/interfaces inherited from interface java.util.Map | 
| Map.Entry<K,V> | 
 
 
 
| Methods inherited from class org.apache.openjpa.lib.util.concurrent.NullSafeConcurrentHashMap | 
| contains, containsKey, containsValue, elements, entrySet, get, keys, keySet, randomEntryIterator, remove, remove, removeRandom, replace, replace, values | 
 
 
 
 
 
| Methods inherited from interface java.util.Map | 
| clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, values | 
 
SizedConcurrentHashMap
public SizedConcurrentHashMap(int size,
                              float load,
                              int concurrencyLevel)
- Parameters:
- size- the maximum size of this map. If additional elements are
 put into the map, overflow will be removed via calls to- overflowRemoved(java.lang.Object, java.lang.Object).
- load- the load factor for the underlying map
- concurrencyLevel- the concurrency level for the underlying map
- See Also:
- ConcurrentHashMap
putIfAbsent
public Object putIfAbsent(Object key,
                          Object value)
- 
- Specified by:
- putIfAbsentin interface- ConcurrentMap
- Overrides:
- putIfAbsentin class- NullSafeConcurrentHashMap
 
- 
 
put
public Object put(Object key,
                  Object value)
- 
- Specified by:
- putin interface- Map
- Overrides:
- putin class- NullSafeConcurrentHashMap
 
- 
 
getMaxSize
public int getMaxSize()
- Description copied from interface: SizedMap
- The maximum number of entries, or Integer.MAX_VALUE for no limit.
 
- 
- Specified by:
- getMaxSizein interface- SizedMap
 
- 
 
setMaxSize
public void setMaxSize(int max)
- Description copied from interface: SizedMap
- The maximum number of entries, or Integer.MAX_VALUE for no limit.
 
- 
- Specified by:
- setMaxSizein interface- SizedMap
 
- 
 
removeOverflow
protected void removeOverflow()
- Equivalent to removeOverflow(false).
 
- 
 
- 
 
removeOverflow
protected void removeOverflow(boolean forPut)
- Removes overflow. If forPutistrue, then
 this usessize() + 1when computing size.
 
- 
 
- 
 
isFull
public boolean isFull()
- Description copied from interface: SizedMap
- Whether the map is full.
 
- 
- Specified by:
- isFullin interface- SizedMap
 
- 
 
overflowRemoved
public void overflowRemoved(Object key,
                            Object value)
- This implementation does nothing.
 
- 
- Specified by:
- overflowRemovedin interface- SizedMap
 
- 
 
Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.