Class ConcurrentIntObjectHashMap<V>
java.lang.Object
com.strobel.collections.concurrent.ConcurrentIntObjectHashMap<V>
- All Implemented Interfaces:
ConcurrentIntObjectMap<V>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private static final class
private static final class
private final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final float
private final byte
protected int
protected static final int
protected static final float
protected static final int
protected int
private static final StripedReentrantLock
protected ConcurrentIntObjectHashMap.IntHashEntry<V>[]
-
Constructor Summary
ConstructorsConstructorDescriptionConcurrentIntObjectHashMap
(int initialCapacity) ConcurrentIntObjectHashMap
(int initialCapacity, float loadFactor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
private static int
computeInitialCapacity
(int initialCapacity, float loadFactor) boolean
contains
(int key) elements()
entries()
get
(int key) private ConcurrentIntObjectHashMap.IntHashEntry
<V> getFirst
(int hash) boolean
isEmpty()
int[]
keys()
private void
lock()
protected V
putIfAbsent
(int key, V value) private V
Read the value of an entry under lock.private void
rehash()
remove
(int key) boolean
protected V
removeCore
(int key, V value) boolean
private void
setTable
(ConcurrentIntObjectHashMap.IntHashEntry<?>[] newTable) int
size()
private int
private void
unlock()
-
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
- Specified by:
addOrGet
in interfaceConcurrentIntObjectMap<V>
-
remove
- Specified by:
remove
in interfaceConcurrentIntObjectMap<V>
-
replace
- Specified by:
replace
in interfaceConcurrentIntObjectMap<V>
-
put
- Specified by:
put
in interfaceConcurrentIntObjectMap<V>
-
putIfAbsent
- Specified by:
putIfAbsent
in interfaceConcurrentIntObjectMap<V>
-
get
- Specified by:
get
in interfaceConcurrentIntObjectMap<V>
-
remove
- Specified by:
remove
in interfaceConcurrentIntObjectMap<V>
-
size
public int size()- Specified by:
size
in interfaceConcurrentIntObjectMap<V>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceConcurrentIntObjectMap<V>
-
contains
public boolean contains(int key) - Specified by:
contains
in interfaceConcurrentIntObjectMap<V>
-
clear
public void clear()- Specified by:
clear
in interfaceConcurrentIntObjectMap<V>
-
keys
- Specified by:
keys
in interfaceConcurrentIntObjectMap<V>
-
entries
- Specified by:
entries
in interfaceConcurrentIntObjectMap<V>
-
elements
-