|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap
org.jboss.util.collection.SoftValueHashMap
public class SoftValueHashMap
This Map will remove entries when the value in the map has been cleaned from garbage collection
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
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 t)
Constructs a new WeakHashMap with the same mappings as the
specified Map. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all mappings from this map. |
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the
specified key. |
Set |
entrySet()
|
Object |
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. |
Object |
put(Object key,
Object value)
Updates this map so that the given key maps to the given
value. |
Object |
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. |
| Methods inherited from class java.util.AbstractMap |
|---|
clone, containsValue, equals, hashCode, keySet, putAll, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
containsValue, equals, hashCode, keySet, putAll, values |
| Constructor Detail |
|---|
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 WeakHashMap
IllegalArgumentException - 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
WeakHashMap
IllegalArgumentException - 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 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.| Method Detail |
|---|
public Set entrySet()
entrySet in interface MapentrySet in class AbstractMappublic int size()
Map interface, the time required by this operation is
linear in the size of the map.
size in interface Mapsize in class AbstractMappublic boolean isEmpty()
true if this map contains no key-value mappings.
isEmpty in interface MapisEmpty in class AbstractMappublic boolean containsKey(Object key)
true if this map contains a mapping for the
specified key.
containsKey in interface MapcontainsKey in class AbstractMapkey - The key whose presence in this map is to be testedpublic Object get(Object key)
key.
If this map does not contain a value for this key, then return
null.
get in interface Mapget in class AbstractMapkey - The key whose associated value, if any, is to be returned
public Object put(Object key,
Object 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.
put in interface Mapput in class AbstractMapkey - The key that is to be mapped to the given
valuevalue - The value to which the given key is to be
mapped
null if if there was no mapping for the keypublic Object remove(Object key)
key from this map, if
present.
remove in interface Mapremove in class AbstractMapkey - The key whose mapping is to be removed
null if
there was no mapping for the keypublic void clear()
clear in interface Mapclear in class AbstractMap
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||