public class ConcurrentIntIntMap extends org.mini2Dx.gdx.utils.IntIntMap implements ConcurrentCollection
| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.lockprovider.ReadWriteLock |
lock |
| Constructor and Description |
|---|
ConcurrentIntIntMap()
Creates a new map with an initial capacity of 51 and a load factor of 0.8.
|
ConcurrentIntIntMap(int initialCapacity)
Creates a new map with a load factor of 0.8.
|
ConcurrentIntIntMap(int initialCapacity,
float loadFactor)
Creates a new map with the specified initial capacity and load factor.
|
ConcurrentIntIntMap(org.mini2Dx.gdx.utils.IntIntMap map)
Creates a new map identical to the specified map.
|
| 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(int key) |
boolean |
containsValue(int value)
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.
|
org.mini2Dx.gdx.utils.IntIntMap.Entries |
entries()
Returns an iterator for the entries in the map.
|
boolean |
equals(java.lang.Object obj) |
int |
findKey(int value,
int notFound)
Returns the key for the specified value, or null if it is not in the map.
|
int |
get(int key,
int defaultValue) |
int |
getAndIncrement(int key,
int defaultValue,
int increment)
Returns the key's current value and increments the stored value.
|
org.mini2Dx.lockprovider.ReadWriteLock |
getLock()
Returns the collection's
ReadWriteLock |
int |
hashCode() |
boolean |
isEmpty()
Returns true if the map is empty.
|
org.mini2Dx.gdx.utils.IntIntMap.Keys |
keys()
Returns an iterator for the keys in the map.
|
boolean |
notEmpty()
Returns true if the map has one or more items.
|
void |
put(int key,
int value) |
int |
put(int key,
int value,
int defaultValue) |
void |
putAll(org.mini2Dx.gdx.utils.IntIntMap map) |
boolean |
putIfAbsent(int key,
int value)
Puts a key/value if the key is not already present
|
boolean |
putIfPresent(int key,
int value)
Puts a key/value if the key is already present
|
int |
remove(int key,
int defaultValue) |
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() |
org.mini2Dx.gdx.utils.IntIntMap.Values |
values()
Returns an iterator for the values in the map.
|
public ConcurrentIntIntMap()
public ConcurrentIntIntMap(int initialCapacity)
initialCapacity - If not a power of two, it is increased to the next nearest power of two.public ConcurrentIntIntMap(int initialCapacity,
float loadFactor)
initialCapacity - If not a power of two, it is increased to the next nearest power of two.loadFactor - public ConcurrentIntIntMap(org.mini2Dx.gdx.utils.IntIntMap map)
map - public int size()
public void put(int key,
int value)
put in class org.mini2Dx.gdx.utils.IntIntMappublic boolean putIfAbsent(int key,
int value)
key - The key to put if absentvalue - The value to put if absentpublic boolean putIfPresent(int key,
int value)
key - The key to put if presentvalue - The value to put if presentpublic int put(int key,
int value,
int defaultValue)
put in class org.mini2Dx.gdx.utils.IntIntMappublic void putAll(org.mini2Dx.gdx.utils.IntIntMap map)
putAll in class org.mini2Dx.gdx.utils.IntIntMappublic int get(int key,
int defaultValue)
get in class org.mini2Dx.gdx.utils.IntIntMapkey - defaultValue - Returned if the key was not associated with a value.public int getAndIncrement(int key,
int defaultValue,
int increment)
getAndIncrement in class org.mini2Dx.gdx.utils.IntIntMapkey - defaultValue - increment - public int remove(int key,
int defaultValue)
remove in class org.mini2Dx.gdx.utils.IntIntMappublic boolean notEmpty()
notEmpty in class org.mini2Dx.gdx.utils.IntIntMappublic boolean isEmpty()
isEmpty in class org.mini2Dx.gdx.utils.IntIntMappublic void shrink(int maximumCapacity)
shrink in class org.mini2Dx.gdx.utils.IntIntMapmaximumCapacity - public void clear(int maximumCapacity)
clear in class org.mini2Dx.gdx.utils.IntIntMapmaximumCapacity - public void clear()
clear in class org.mini2Dx.gdx.utils.IntIntMappublic boolean containsValue(int value)
containsValue in class org.mini2Dx.gdx.utils.IntIntMapvalue - public boolean containsKey(int key)
containsKey in class org.mini2Dx.gdx.utils.IntIntMappublic int findKey(int value,
int notFound)
findKey in class org.mini2Dx.gdx.utils.IntIntMapvalue - notFound - public void ensureCapacity(int additionalCapacity)
ensureCapacity in class org.mini2Dx.gdx.utils.IntIntMapadditionalCapacity - public int hashCode()
hashCode in class org.mini2Dx.gdx.utils.IntIntMappublic boolean equals(java.lang.Object obj)
equals in class org.mini2Dx.gdx.utils.IntIntMappublic java.lang.String toString()
toString in class org.mini2Dx.gdx.utils.IntIntMappublic org.mini2Dx.gdx.utils.IntIntMap.Entries entries()
entries in class org.mini2Dx.gdx.utils.IntIntMappublic org.mini2Dx.gdx.utils.IntIntMap.Values values()
values in class org.mini2Dx.gdx.utils.IntIntMappublic org.mini2Dx.gdx.utils.IntIntMap.Keys keys()
keys in class org.mini2Dx.gdx.utils.IntIntMappublic org.mini2Dx.lockprovider.ReadWriteLock getLock()
ConcurrentCollectionReadWriteLockgetLock in interface ConcurrentCollectionReadWriteLock