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