public class ConcurrentCharMap<T> extends CharMap<T> implements ConcurrentCollection
CharMap.Entries<V>, CharMap.Entry<V>, CharMap.Keys, CharMap.Values<V>
Modifier and Type | Field and Description |
---|---|
protected ReadWriteLock |
lock |
Constructor and Description |
---|
ConcurrentCharMap()
Creates a new map with an initial capacity of 51 and a load factor of 0.8.
|
ConcurrentCharMap(CharMap<? extends T> map)
Creates a new map identical to the specified map.
|
ConcurrentCharMap(int initialCapacity)
Creates a new map with a load factor of 0.8.
|
ConcurrentCharMap(int initialCapacity,
float loadFactor)
Creates a new map with the specified initial capacity and load factor.
|
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(char 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.
|
CharMap.Entries<T> |
entries()
Returns an iterator for the entries in the map.
|
boolean |
equals(java.lang.Object object) |
char |
findKey(java.lang.Object value,
boolean identity,
char notFound)
Returns the key for the specified value, or notFound if it is not in the map.
|
T |
get(char key,
T defaultValue) |
ReadWriteLock |
getLock()
Returns the collection's
ReadWriteLock |
int |
hashCode() |
CharMap.Keys |
keys()
Returns an iterator for the keys in the map.
|
T |
put(char key,
T value) |
void |
putAll(CharMap<T> map) |
T |
remove(char key) |
void |
shrink(int maximumCapacity)
Reduces the size of the backing arrays to be the specified capacity or less.
|
java.lang.String |
toString() |
CharMap.Values<T> |
values()
Returns an iterator for the values in the map.
|
protected ReadWriteLock lock
public ConcurrentCharMap()
public ConcurrentCharMap(int initialCapacity)
initialCapacity
- If not a power of two, it is increased to the next nearest power of two.public ConcurrentCharMap(int initialCapacity, float loadFactor)
initialCapacity
- If not a power of two, it is increased to the next nearest power of two.loadFactor
- public void shrink(int maximumCapacity)
CharMap
public void clear(int maximumCapacity)
CharMap
public boolean containsValue(java.lang.Object value, boolean identity)
CharMap
containsValue
in class CharMap<T>
public boolean containsKey(char key)
containsKey
in class CharMap<T>
public char findKey(java.lang.Object value, boolean identity, char notFound)
CharMap
findKey
in class CharMap<T>
identity
- If true, uses == to compare the specified value with values in the map. If false, uses
CharMap.equals(Object)
.public void ensureCapacity(int additionalCapacity)
CharMap
ensureCapacity
in class CharMap<T>
public CharMap.Entries<T> entries()
CharMap
CharMap.Entries
constructor for nested or multithreaded iteration.public CharMap.Values<T> values()
CharMap
CharMap.Entries
constructor for nested or multithreaded iteration.public CharMap.Keys keys()
CharMap
CharMap.Entries
constructor for nested or multithreaded iteration.public ReadWriteLock getLock()
ConcurrentCollection
ReadWriteLock
getLock
in interface ConcurrentCollection
ReadWriteLock