public class ConcurrentByteTreeMap<T> extends ByteTreeMap<T> implements ConcurrentCollection
ByteTreeMap.SortedKeysByteMap.Entries<V>, ByteMap.Entry<V>, ByteMap.Keys, ByteMap.Values<V>| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.lockprovider.ReadWriteLock |
lock |
| Constructor and Description |
|---|
ConcurrentByteTreeMap() |
ConcurrentByteTreeMap(ByteMap<? extends T> map)
NOTE: read access to the other map is not thread-safe
|
ConcurrentByteTreeMap(int initialCapacity) |
ConcurrentByteTreeMap(int initialCapacity,
float loadFactor) |
| Modifier and Type | Method and Description |
|---|---|
ByteMap.Keys |
ascendingKeys() |
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.
|
ByteMap.Keys |
descendingKeys() |
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) |
org.mini2Dx.lockprovider.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) |
boolean |
putIfAbsent(byte key,
T value)
Puts a key/value if the key is not already present
|
boolean |
putIfPresent(byte key,
T value)
Puts a key/value if the key is already present
|
T |
remove(byte key) |
void |
shrink(int maximumCapacity)
Reduces the size of the backing arrays to be the specified capacity or less.
|
int |
size()
Returns the size in a thread-safe manner
|
java.lang.String |
toString() |
ByteMap.Values<T> |
values()
Returns an iterator for the values in the map.
|
public ConcurrentByteTreeMap()
public ConcurrentByteTreeMap(int initialCapacity)
public ConcurrentByteTreeMap(int initialCapacity,
float loadFactor)
public int size()
public T put(byte key, T value)
put in class ByteTreeMap<T>public boolean putIfAbsent(byte key,
T value)
key - The key to put if absentvalue - The value to put if absentpublic boolean putIfPresent(byte key,
T value)
key - The key to put if presentvalue - The value to put if presentpublic void putAll(ByteMap<T> map)
putAll in class ByteTreeMap<T>public T remove(byte key)
remove in class ByteTreeMap<T>public void shrink(int maximumCapacity)
ByteMappublic void clear(int maximumCapacity)
ByteMapclear in class ByteTreeMap<T>public void clear()
clear in class ByteTreeMap<T>public boolean containsValue(java.lang.Object value,
boolean identity)
ByteMapcontainsValue 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)
ByteMapnotFound if it is not in the map. Note this traverses the entire map
and compares every value, which may be an expensive operation.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)
ByteMapensureCapacity in class ByteMap<T>public ByteMap.Entries<T> entries()
ByteMapByteMap.Entries constructor for nested or multithreaded iteration.public ByteMap.Values<T> values()
ByteMapByteMap.Entries constructor for nested or multithreaded iteration.public ByteMap.Keys keys()
ByteMapByteMap.Entries constructor for nested or multithreaded iteration.public ByteMap.Keys ascendingKeys()
ascendingKeys in class ByteTreeMap<T>public ByteMap.Keys descendingKeys()
descendingKeys in class ByteTreeMap<T>public org.mini2Dx.lockprovider.ReadWriteLock getLock()
ConcurrentCollectionReadWriteLockgetLock in interface ConcurrentCollectionReadWriteLock