Top Inners Fields Constructors Methods
org.aspectj.util

public Class SoftHashMap<K, V>

extends AbstractMap<K, V>
Class Inheritance
Imports
java.lang.ref.ReferenceQueue, .SoftReference, java.util.AbstractMap, .Collections, .HashMap, .Map

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private Map<K, SoftHashMap<K, V>.SpecialValue>
private ReferenceQueue<? super V>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides java.util.AbstractMap.clear.

Implements java.util.Map.clear.

Removes all of the mappings from this map (optional operation).
public Set<Map.Entry<K, V>>
entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.
public V
get(Object
the key whose associated value is to be returned
key
)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
private void
public V
put(K
key with which the specified value is to be associated
k
,
V
value to be associated with the specified key
v
)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).
public V
remove(Object
key whose mapping is to be removed from the map
k
)

Overrides java.util.AbstractMap.remove.

Implements java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation).
public int
size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.
Inherited from java.util.AbstractMap:
clonecontainsKeycontainsValueequalshashCodeisEmptykeySetputAlltoStringvalues

Field Detail

mapback to summary
private Map<K, SoftHashMap<K, V>.SpecialValue> map
rqback to summary
private ReferenceQueue<? super V> rq

Constructor Detail

SoftHashMapback to summary
public SoftHashMap()

Method Detail

clearback to summary
public void clear()

Overrides java.util.AbstractMap.clear.

Implements java.util.Map.clear.

Doc from java.util.AbstractMap.clear.

Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.

Annotations
@Override
entrySetback to summary
public Set<Map.Entry<K, V>> entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Doc from java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Set<Map.Entry<K, V>>

a set view of the mappings contained in this map

Annotations
@Override
getback to summary
public V get(Object key)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Doc from java.util.AbstractMap.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that Objects.equals(key, k), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

If this map permits null values, then a return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Parameters
key:Object

Doc from java.util.Map.get.

the key whose associated value is to be returned

Returns:V

Doc from java.util.Map.get.

the value to which the specified key is mapped, or null if this map contains no mapping for the key

Annotations
@Override
processQueueback to summary
private void processQueue()
Annotations
@SuppressWarnings:unchecked
putback to summary
public V put(K k, V v)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Doc from java.util.AbstractMap.put.

Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

Parameters
k:K

Doc from java.util.Map.put.

key with which the specified value is to be associated

v:V

Doc from java.util.Map.put.

value to be associated with the specified key

Returns:V

Doc from java.util.Map.put.

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)

Annotations
@Override
removeback to summary
public V remove(Object k)

Overrides java.util.AbstractMap.remove.

Implements java.util.Map.remove.

Doc from java.util.AbstractMap.remove.

Removes the mapping for a key from this map if it is present (optional operation). More formally, if this map contains a mapping from key k to value v such that Objects.equals(key, k), that mapping is removed. (The map can contain at most one such mapping.)

Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.

If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.

The map will not contain a mapping for the specified key once the call returns.

Parameters
k:Object

Doc from java.util.Map.remove.

key whose mapping is to be removed from the map

Returns:V

Doc from java.util.Map.remove.

the previous value associated with key, or null if there was no mapping for key.

Annotations
@Override
sizeback to summary
public int size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Doc from java.util.AbstractMap.size.

Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

Doc from java.util.Map.size.

the number of key-value mappings in this map

Annotations
@Override
org.aspectj.util back to summary

pack-priv Class SoftHashMap.SpecialValue

extends SoftReference<V>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final K

Constructor Summary

AccessConstructor and Description
pack-priv
SpecialValue(K k, V v)

Method Summary

Inherited from java.lang.ref.SoftReference:
get

Field Detail

keyback to summary
private final K key

Constructor Detail

SpecialValueback to summary
pack-priv SpecialValue(K k, V v)