Map<K,V>public class SoftValueHashMap<K,V> extends Object implements Map<K,V>
| Constructor | Description |
|---|---|
SoftValueHashMap() |
Constructs a new, empty
WeakHashMap with the default
initial capacity and the default load factor, which is 0.75. |
SoftValueHashMap(int initialCapacity) |
Constructs a new, empty
WeakHashMap with the given initial
capacity and the default load factor, which is 0.75. |
SoftValueHashMap(int initialCapacity,
float loadFactor) |
Constructs a new, empty
WeakHashMap with the given initial
capacity and the given load factor. |
SoftValueHashMap(Map<K,V> t) |
Constructs a new
WeakHashMap with the same mappings as the
specified Map. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
clear() |
Removes all mappings from this map.
|
boolean |
containsKey(Object key) |
Returns
true if this map contains a mapping for the
specified key. |
boolean |
containsValue(Object arg0) |
|
Set<Map.Entry<K,V>> |
entrySet() |
Returns a set of the mappings contained in this hash table.
|
V |
get(Object key) |
Returns the value to which this map maps the specified
key. |
boolean |
isEmpty() |
Returns
true if this map contains no key-value mappings. |
Set<K> |
keySet() |
|
V |
put(K key,
V value) |
Updates this map so that the given
key maps to the given
value. |
void |
putAll(Map<? extends K,? extends V> arg0) |
|
V |
remove(Object key) |
Removes the mapping for the given
key from this map, if
present. |
int |
size() |
Returns the number of key-value mappings in this map.
|
Collection<V> |
values() |
public SoftValueHashMap(int initialCapacity,
float loadFactor)
WeakHashMap with the given initial
capacity and the given load factor.initialCapacity - The initial capacity of the WeakHashMaploadFactor - The load factor of the WeakHashMapIllegalArgumentException - If the initial capacity is less than zero, or if the load
factor is nonpositivepublic SoftValueHashMap(int initialCapacity)
WeakHashMap with the given initial
capacity and the default load factor, which is 0.75.initialCapacity - The initial capacity of the WeakHashMapIllegalArgumentException - If the initial capacity is less than zeropublic SoftValueHashMap()
WeakHashMap with the default
initial capacity and the default load factor, which is 0.75.public SoftValueHashMap(Map<K,V> t)
WeakHashMap with the same mappings as the
specified Map. The WeakHashMap is created with
an initial capacity of twice the number of mappings in the specified map
or 11 (whichever is greater), and a default load factor, which is
0.75.t - the map whose mappings are to be placed in this map.public Set<Map.Entry<K,V>> entrySet()
public int size()
Map interface, the time required by this operation is
linear in the size of the map.public boolean isEmpty()
true if this map contains no key-value mappings.public boolean containsKey(Object key)
true if this map contains a mapping for the
specified key.containsKey in interface Map<K,V>key - The key whose presence in this map is to be tested.public V get(Object key)
key.
If this map does not contain a value for this key, then return
null.public V put(K key, V value)
key maps to the given
value. If the map previously contained a mapping for
key then that mapping is replaced and the previous value
is returned.public V remove(Object key)
key from this map, if
present.public void clear()
public boolean containsValue(Object arg0)
containsValue in interface Map<K,V>Copyright © 2018 Shigeru Chiba, www.javassist.org. All rights reserved.