public class ConcurrentLongMap<T> extends org.mini2Dx.gdx.utils.LongMap<T> implements ConcurrentCollection
| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.lockprovider.ReadWriteLock |
lock |
| Constructor and Description |
|---|
ConcurrentLongMap()
Creates a new map with an initial capacity of 51 and a load factor of 0.8.
|
ConcurrentLongMap(int initialCapacity)
Creates a new map with a load factor of 0.8.
|
ConcurrentLongMap(int initialCapacity,
float loadFactor)
Creates a new map with the specified initial capacity and load factor.
|
ConcurrentLongMap(org.mini2Dx.gdx.utils.LongMap<? extends T> 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(long key) |
void |
ensureCapacity(int additionalCapacity)
Increases the size of the backing array to accommodate the specified number of additional items.
|
org.mini2Dx.gdx.utils.LongMap.Entries<T> |
entries()
Returns an iterator for the entries in the map.
|
boolean |
equals(java.lang.Object obj) |
T |
get(long key) |
T |
get(long key,
T defaultValue) |
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.LongMap.Keys |
keys()
Returns an iterator for the keys in the map.
|
boolean |
notEmpty()
Returns true if the map has one or more items.
|
T |
put(long key,
T value) |
void |
putAll(org.mini2Dx.gdx.utils.LongMap<? extends T> map) |
boolean |
putIfAbsent(long key,
T value)
Puts a key/value if the key is not already present
|
boolean |
putIfPresent(long key,
T value)
Puts a key/value if the key is already present
|
T |
remove(long 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() |
org.mini2Dx.gdx.utils.LongMap.Values<T> |
values()
Returns an iterator for the values in the map.
|
containsValue, equalsIdentity, findKey, iterator, placepublic ConcurrentLongMap()
public ConcurrentLongMap(int initialCapacity)
initialCapacity - If not a power of two, it is increased to the next nearest power of two.public ConcurrentLongMap(int initialCapacity,
float loadFactor)
initialCapacity - If not a power of two, it is increased to the next nearest power of two.loadFactor - public ConcurrentLongMap(org.mini2Dx.gdx.utils.LongMap<? extends T> map)
map - public int size()
public boolean putIfAbsent(long key,
T value)
key - The key to put if absentvalue - The value to put if absentpublic boolean putIfPresent(long key,
T value)
key - The key to put if presentvalue - The value to put if presentpublic void putAll(org.mini2Dx.gdx.utils.LongMap<? extends T> map)
putAll in class org.mini2Dx.gdx.utils.LongMap<T>public T get(long key, T defaultValue)
get in class org.mini2Dx.gdx.utils.LongMap<T>key - defaultValue - Returned if the key was not associated with a value.public boolean notEmpty()
notEmpty in class org.mini2Dx.gdx.utils.LongMap<T>public boolean isEmpty()
isEmpty in class org.mini2Dx.gdx.utils.LongMap<T>public void shrink(int maximumCapacity)
shrink in class org.mini2Dx.gdx.utils.LongMap<T>maximumCapacity - public void clear(int maximumCapacity)
clear in class org.mini2Dx.gdx.utils.LongMap<T>maximumCapacity - public void clear()
clear in class org.mini2Dx.gdx.utils.LongMap<T>public boolean containsKey(long key)
containsKey in class org.mini2Dx.gdx.utils.LongMap<T>public void ensureCapacity(int additionalCapacity)
ensureCapacity in class org.mini2Dx.gdx.utils.LongMap<T>additionalCapacity - public int hashCode()
hashCode in class org.mini2Dx.gdx.utils.LongMap<T>public boolean equals(java.lang.Object obj)
equals in class org.mini2Dx.gdx.utils.LongMap<T>public java.lang.String toString()
toString in class org.mini2Dx.gdx.utils.LongMap<T>public org.mini2Dx.gdx.utils.LongMap.Entries<T> entries()
If Collections.allocateIterators is false, the same iterator instance is returned each time this method is called. Use the
Entries constructor for nested or multithreaded iteration.
entries in class org.mini2Dx.gdx.utils.LongMap<T>public org.mini2Dx.gdx.utils.LongMap.Values<T> values()
If Collections.allocateIterators is false, the same iterator instance is returned each time this method is called. Use the
Entries constructor for nested or multithreaded iteration.
values in class org.mini2Dx.gdx.utils.LongMap<T>public org.mini2Dx.gdx.utils.LongMap.Keys keys()
If Collections.allocateIterators is false, the same iterator instance is returned each time this method is called. Use the
Entries constructor for nested or multithreaded iteration.
keys in class org.mini2Dx.gdx.utils.LongMap<T>public org.mini2Dx.lockprovider.ReadWriteLock getLock()
ConcurrentCollectionReadWriteLockgetLock in interface ConcurrentCollectionReadWriteLock