public class ConcurrentShortMap<T> extends ShortMap<T> implements ConcurrentCollection
ShortMap.Entries<V>, ShortMap.Entry<V>, ShortMap.Keys, ShortMap.Values<V>
Modifier and Type | Field and Description |
---|---|
protected ReadWriteLock |
lock |
Constructor and Description |
---|
ConcurrentShortMap() |
ConcurrentShortMap(int initialCapacity) |
ConcurrentShortMap(int initialCapacity,
float loadFactor) |
ConcurrentShortMap(ShortMap<? extends T> map)
NOTE: read access to the other map is not thread-safe
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
clear(int maximumCapacity)
Clears the map and reduces the size of the backing arrays to be the specified capacity if they are larger.
|
boolean |
containsKey(short key) |
boolean |
containsValue(java.lang.Object value,
boolean identity)
Returns true if the specified value is in the map.
|
void |
ensureCapacity(int additionalCapacity)
Increases the size of the backing array to accommodate the specified number of additional items.
|
ShortMap.Entries<T> |
entries()
Returns an iterator for the entries in the map.
|
boolean |
equals(java.lang.Object object) |
short |
findKey(java.lang.Object value,
boolean identity,
short notFound)
Returns the key for the specified value, or notFound if it is not in the map.
|
T |
get(short key,
T defaultValue) |
ReadWriteLock |
getLock()
Returns the collection's
ReadWriteLock |
int |
hashCode() |
ShortMap.Keys |
keys()
Returns an iterator for the keys in the map.
|
T |
put(short key,
T value) |
void |
putAll(ShortMap<T> map) |
T |
remove(short key) |
void |
shrink(int maximumCapacity)
Reduces the size of the backing arrays to be the specified capacity or less.
|
java.lang.String |
toString() |
ShortMap.Values<T> |
values()
Returns an iterator for the values in the map.
|
protected ReadWriteLock lock
public ConcurrentShortMap()
public ConcurrentShortMap(int initialCapacity)
public ConcurrentShortMap(int initialCapacity, float loadFactor)
public void shrink(int maximumCapacity)
ShortMap
public void clear(int maximumCapacity)
ShortMap
public boolean containsValue(java.lang.Object value, boolean identity)
ShortMap
containsValue
in class ShortMap<T>
public boolean containsKey(short key)
containsKey
in class ShortMap<T>
public short findKey(java.lang.Object value, boolean identity, short notFound)
ShortMap
findKey
in class ShortMap<T>
identity
- If true, uses == to compare the specified value with values in the map. If false, uses
ShortMap.equals(Object)
.public void ensureCapacity(int additionalCapacity)
ShortMap
ensureCapacity
in class ShortMap<T>
public ShortMap.Entries<T> entries()
ShortMap
ShortMap.Entries
constructor for nested or multithreaded iteration.public ShortMap.Values<T> values()
ShortMap
ShortMap.Entries
constructor for nested or multithreaded iteration.public ShortMap.Keys keys()
ShortMap
ShortMap.Entries
constructor for nested or multithreaded iteration.public ReadWriteLock getLock()
ConcurrentCollection
ReadWriteLock
getLock
in interface ConcurrentCollection
ReadWriteLock