public class ConcurrentShortTreeMap<T> extends ShortTreeMap<T> implements ConcurrentCollection
ShortTreeMap.SortedKeysShortMap.Entries<V>, ShortMap.Entry<V>, ShortMap.Keys, ShortMap.Values<V>| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.lockprovider.ReadWriteLock |
lock |
| Constructor and Description |
|---|
ConcurrentShortTreeMap() |
ConcurrentShortTreeMap(int initialCapacity) |
ConcurrentShortTreeMap(int initialCapacity,
float loadFactor) |
ConcurrentShortTreeMap(ShortMap<? extends T> map)
NOTE: read access to the other map is not thread-safe
|
| Modifier and Type | Method and Description |
|---|---|
ShortMap.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(short key) |
boolean |
containsValue(java.lang.Object value,
boolean identity)
Returns true if the specified value is in the map.
|
ShortMap.Keys |
descendingKeys() |
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) |
org.mini2Dx.lockprovider.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) |
boolean |
putIfAbsent(short key,
T value)
Puts a key/value if the key is not already present
|
boolean |
putIfPresent(short key,
T value)
Puts a key/value if the key is already present
|
T |
remove(short 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() |
ShortMap.Values<T> |
values()
Returns an iterator for the values in the map.
|
public ConcurrentShortTreeMap()
public ConcurrentShortTreeMap(int initialCapacity)
public ConcurrentShortTreeMap(int initialCapacity,
float loadFactor)
public int size()
public T put(short key, T value)
put in class ShortTreeMap<T>public boolean putIfAbsent(short key,
T value)
key - The key to put if absentvalue - The value to put if absentpublic boolean putIfPresent(short key,
T value)
key - The key to put if presentvalue - The value to put if presentpublic void putAll(ShortMap<T> map)
putAll in class ShortTreeMap<T>public T remove(short key)
remove in class ShortTreeMap<T>public void shrink(int maximumCapacity)
ShortMappublic void clear(int maximumCapacity)
ShortMapclear in class ShortTreeMap<T>public void clear()
clear in class ShortTreeMap<T>public boolean containsValue(java.lang.Object value,
boolean identity)
ShortMapcontainsValue 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)
ShortMapfindKey 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)
ShortMapensureCapacity in class ShortMap<T>public ShortMap.Entries<T> entries()
ShortMapShortMap.Entries constructor for nested or multithreaded iteration.public ShortMap.Values<T> values()
ShortMapShortMap.Entries constructor for nested or multithreaded iteration.public ShortMap.Keys keys()
ShortMapShortMap.Entries constructor for nested or multithreaded iteration.public ShortMap.Keys ascendingKeys()
ascendingKeys in class ShortTreeMap<T>public ShortMap.Keys descendingKeys()
descendingKeys in class ShortTreeMap<T>public org.mini2Dx.lockprovider.ReadWriteLock getLock()
ConcurrentCollectionReadWriteLockgetLock in interface ConcurrentCollectionReadWriteLock