public class ConcurrentLruIntMap<T> extends LruIntMap<T> implements ConcurrentCollection
| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.lockprovider.ReadWriteLock |
lock |
DEFAULT_MAX_CAPACITY| Constructor and Description |
|---|
ConcurrentLruIntMap() |
ConcurrentLruIntMap(int initialCapacity) |
ConcurrentLruIntMap(int initialCapacity,
float loadFactor) |
ConcurrentLruIntMap(int initialCapacity,
int maxCapacity) |
ConcurrentLruIntMap(int initialCapacity,
int maxCapacity,
float loadFactor) |
ConcurrentLruIntMap(org.mini2Dx.gdx.utils.IntMap<? extends T> map)
NOTE: read access to the other map is not thread-safe
|
ConcurrentLruIntMap(org.mini2Dx.gdx.utils.IntMap<? extends T> map,
int maxCapacity)
NOTE: read access to the other map is not thread-safe
|
| 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) |
void |
ensureCapacity(int additionalCapacity)
Increases the size of the backing array to accommodate the specified number of additional items.
|
org.mini2Dx.gdx.utils.IntMap.Entries<T> |
entries()
Returns an iterator for the entries in the map.
|
boolean |
equals(java.lang.Object obj) |
int |
findKey(java.lang.Object value,
boolean identity,
int notFound)
Returns the key for the specified value, or
notFound if it is not in the map. |
T |
get(int key) |
T |
get(int key,
T defaultValue) |
org.mini2Dx.lockprovider.ReadWriteLock |
getLock()
Returns the collection's
ReadWriteLock |
int |
getMaxCapacity()
Returns the maximum number of keys that can be stored in the
LruIntMap |
int |
hashCode() |
boolean |
isEmpty()
Returns true if the map is empty.
|
org.mini2Dx.gdx.utils.IntMap.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(int key,
T value) |
void |
putAll(org.mini2Dx.gdx.utils.IntMap<? extends T> map) |
boolean |
putIfAbsent(int key,
T value)
Puts a key/value if the key is not already present
|
boolean |
putIfPresent(int key,
T value)
Puts a key/value if the key is already present
|
T |
remove(int 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.IntMap.Values<T> |
values()
Returns an iterator for the values in the map.
|
containsValue, equalsIdentity, iterator, placepublic ConcurrentLruIntMap()
public ConcurrentLruIntMap(int initialCapacity)
public ConcurrentLruIntMap(int initialCapacity,
float loadFactor)
public ConcurrentLruIntMap(org.mini2Dx.gdx.utils.IntMap<? extends T> map)
map - public ConcurrentLruIntMap(int initialCapacity,
int maxCapacity)
public ConcurrentLruIntMap(int initialCapacity,
int maxCapacity,
float loadFactor)
public ConcurrentLruIntMap(org.mini2Dx.gdx.utils.IntMap<? extends T> map, int maxCapacity)
map - public int size()
public boolean putIfAbsent(int key,
T value)
key - The key to put if absentvalue - The value to put if absentpublic boolean putIfPresent(int key,
T value)
key - The key to put if presentvalue - The value to put if presentpublic void putAll(org.mini2Dx.gdx.utils.IntMap<? extends T> map)
public boolean notEmpty()
notEmpty in class org.mini2Dx.gdx.utils.IntMap<T>public boolean isEmpty()
isEmpty in class org.mini2Dx.gdx.utils.IntMap<T>public void shrink(int maximumCapacity)
shrink in class org.mini2Dx.gdx.utils.IntMap<T>maximumCapacity - public void clear(int maximumCapacity)
clear in class org.mini2Dx.gdx.utils.IntMap<T>maximumCapacity - public boolean containsKey(int key)
containsKey in class org.mini2Dx.gdx.utils.IntMap<T>public int findKey(java.lang.Object value,
boolean identity,
int notFound)
notFound 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 org.mini2Dx.gdx.utils.IntMap<T>value - identity - If true, uses == to compare the specified value with values in the map. If false, uses
equals(Object).notFound - public void ensureCapacity(int additionalCapacity)
ensureCapacity in class org.mini2Dx.gdx.utils.IntMap<T>additionalCapacity - public int hashCode()
hashCode in class org.mini2Dx.gdx.utils.IntMap<T>public boolean equals(java.lang.Object obj)
equals in class org.mini2Dx.gdx.utils.IntMap<T>public java.lang.String toString()
toString in class org.mini2Dx.gdx.utils.IntMap<T>public int getMaxCapacity()
LruIntMapLruIntMapgetMaxCapacity in class LruIntMap<T>public org.mini2Dx.gdx.utils.IntMap.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.IntMap<T>public org.mini2Dx.gdx.utils.IntMap.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.IntMap<T>public org.mini2Dx.gdx.utils.IntMap.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.IntMap<T>public org.mini2Dx.lockprovider.ReadWriteLock getLock()
ConcurrentCollectionReadWriteLockgetLock in interface ConcurrentCollectionReadWriteLock