Class ConcurrentIntObjectHashMap<V>
java.lang.Object
com.strobel.collections.concurrent.ConcurrentIntObjectHashMap<V>
- All Implemented Interfaces:
ConcurrentIntObjectMap<V>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static final classprivate static final classprivate final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatprivate final byteprotected intprotected static final intprotected static final floatprotected static final intprotected intprivate static final StripedReentrantLockprotected ConcurrentIntObjectHashMap.IntHashEntry<V>[] -
Constructor Summary
ConstructorsConstructorDescriptionConcurrentIntObjectHashMap(int initialCapacity) ConcurrentIntObjectHashMap(int initialCapacity, float loadFactor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()private static intcomputeInitialCapacity(int initialCapacity, float loadFactor) booleancontains(int key) elements()entries()get(int key) private ConcurrentIntObjectHashMap.IntHashEntry<V> getFirst(int hash) booleanisEmpty()int[]keys()private voidlock()protected VputIfAbsent(int key, V value) private VRead the value of an entry under lock.private voidrehash()remove(int key) booleanprotected VremoveCore(int key, V value) booleanprivate voidsetTable(ConcurrentIntObjectHashMap.IntHashEntry<?>[] newTable) intsize()private intprivate voidunlock()
-
Field Details
-
DEFAULT_INITIAL_CAPACITY
protected static final int DEFAULT_INITIAL_CAPACITY- See Also:
-
MAXIMUM_CAPACITY
protected static final int MAXIMUM_CAPACITY- See Also:
-
DEFAULT_LOAD_FACTOR
protected static final float DEFAULT_LOAD_FACTOR- See Also:
-
STRIPED_REENTRANT_LOCK
-
_lockIndex
private final byte _lockIndex -
table
-
count
protected volatile int count -
modCount
protected int modCount -
_loadFactor
private final float _loadFactor
-
-
Constructor Details
-
ConcurrentIntObjectHashMap
public ConcurrentIntObjectHashMap() -
ConcurrentIntObjectHashMap
public ConcurrentIntObjectHashMap(int initialCapacity) -
ConcurrentIntObjectHashMap
public ConcurrentIntObjectHashMap(int initialCapacity, float loadFactor)
-
-
Method Details
-
lock
private void lock() -
unlock
private void unlock() -
threshold
private int threshold() -
setTable
-
computeInitialCapacity
private static int computeInitialCapacity(int initialCapacity, float loadFactor) -
getFirst
-
readValueUnderLock
Read the value of an entry under lock. Called if the value field appears to benull. -
rehash
private void rehash() -
put
-
removeCore
-
addOrGet
-
remove
- Specified by:
removein interfaceConcurrentIntObjectMap<V>
-
replace
-
put
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceConcurrentIntObjectMap<V>
-
get
- Specified by:
getin interfaceConcurrentIntObjectMap<V>
-
remove
- Specified by:
removein interfaceConcurrentIntObjectMap<V>
-
size
public int size()- Specified by:
sizein interfaceConcurrentIntObjectMap<V>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceConcurrentIntObjectMap<V>
-
contains
public boolean contains(int key) - Specified by:
containsin interfaceConcurrentIntObjectMap<V>
-
clear
public void clear()- Specified by:
clearin interfaceConcurrentIntObjectMap<V>
-
keys
- Specified by:
keysin interfaceConcurrentIntObjectMap<V>
-
entries
- Specified by:
entriesin interfaceConcurrentIntObjectMap<V>
-
elements
-