public final class SoftValueMap extends Object implements Map
| 构造器和说明 |
|---|
SoftValueMap()
Equivalent to
SoftValueMap(1, 1). |
SoftValueMap(int initialCapacity,
float loadFactor,
int readClearCheckFrequency,
int writeClearCheckFrequency)
Constructs a SoftValueMap with specified initial capacity, load factor,
and cleared value removal frequencies.
|
SoftValueMap(int readClearCheckFrequency,
int writeClearCheckFrequency)
Equivalent to
SoftValueMap(11, 0.75F, getClearCheckFrequency, putClearCheckFrequency). |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set |
entrySet() |
boolean |
equals(Object rhs) |
Object |
get(Object key)
Returns the value that is mapped to a given 'key'.
|
int |
hashCode() |
boolean |
isEmpty()
Returns 'false' is this map contains key-value mappings (even if some of
the values may have been cleared already but not removed from the table).
|
Set |
keySet() |
Object |
put(Object key,
Object value)
Updates the table to map 'key' to 'value'.
|
void |
putAll(Map map) |
Object |
remove(Object key) |
int |
size()
Returns the number of key-value mappings in this map.
|
String |
toString()
Overrides Object.toString() for debug purposes.
|
Collection |
values() |
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic SoftValueMap()
SoftValueMap(1, 1).public SoftValueMap(int readClearCheckFrequency,
int writeClearCheckFrequency)
SoftValueMap(11, 0.75F, getClearCheckFrequency, putClearCheckFrequency).public SoftValueMap(int initialCapacity,
float loadFactor,
int readClearCheckFrequency,
int writeClearCheckFrequency)
initialCapacity - initial number of hash buckets in the table
[may not be negative, 0 is equivalent to 1].loadFactor - the load factor to use to determine rehashing points
[must be in (0.0, 1.0] range].readClearCheckFrequency - specifies that every readClearCheckFrequency
get(java.lang.Object) should check for and remove all mappings whose soft values
have been cleared by the garbage collector [may not be less than 1].writeClearCheckFrequency - specifies that every writeClearCheckFrequency
put(java.lang.Object, java.lang.Object) should check for and remove all mappings whose soft values
have been cleared by the garbage collector [may not be less than 1].public String toString()
public int size()
NOTE: in contrast with the java.util.WeakHashMap implementation, this is a constant time operation.
public boolean isEmpty()
NOTE: in contrast with the java.util.WeakHashMap implementation, this is a constant time operation.
public Object get(Object key)
public Object put(Object key, Object value)
public boolean containsKey(Object key)
containsKey 在接口中 Mappublic boolean containsValue(Object value)
containsValue 在接口中 Mappublic Collection values()
Copyright © 2018. All rights reserved.