|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--serp.util.RefKeyMap
ReferenceMap.
Abstract base class for maps whose keys are stored as weak or soft
references. This class is more flexible than the standard
WeakHashMap because it also allows soft references and because it
can inherit the functionality of any other map type. For example, it can
use JVM identity-based hashing if constructed with an
IdentityMap or maintain its entries in insertion order if
constructed with a LinkedHashMap.
Subclasses must define the createRefMapKey(java.lang.Object, java.lang.ref.ReferenceQueue, boolean) method
only. Expired values are removed from the map before any mutator methods;
removing before accessor methods can lead to
ConcurrentModificationExceptions. Thus, the following methods may
produce results which include key/value pairs that have expired:
sizeisEmptycontainsKeykeySet.size,contains,isEmptyentrySet.size,contains,isEmptyvalues.size,contains,isEmptyBy default, all methods are delegated to the internal map provided at
construction. Thus, the ordering, etc of the given map will be preserved;
however, the hashing algorithm cannot be duplicated. A special case is
made for the IdentityMap's hashing, which is supported.
Performance is similar to that of the internal map instance.
| Inner Class Summary | |
(package private) static interface |
RefKeyMap.RefMapKey
Deprecated. Represents a key held by weak or soft reference. |
| Inner classes inherited from class java.util.Map |
Map.Entry |
| Constructor Summary | |
RefKeyMap()
Deprecated. Equivalent to RefKeyMap (new HashMap ()). |
|
RefKeyMap(Map map)
Deprecated. Construct a RefKeyMap with the given interal map. |
|
| Method Summary | |
void |
clear()
Deprecated. |
boolean |
containsKey(Object key)
Deprecated. |
boolean |
containsValue(Object value)
Deprecated. |
protected abstract RefKeyMap.RefMapKey |
createRefMapKey(Object key,
ReferenceQueue queue,
boolean identity)
Deprecated. Create a weak or soft reference to hold the given key. |
Set |
entrySet()
Deprecated. |
boolean |
equals(Object other)
Deprecated. |
Object |
get(Object key)
Deprecated. |
boolean |
isEmpty()
Deprecated. |
Set |
keySet()
Deprecated. |
boolean |
makeHard(Object key)
Deprecated. Harden the reference for the given key. |
boolean |
makeReference(Object key)
Deprecated. Soften the reference for the given key. |
Object |
put(Object key,
Object value)
Deprecated. |
void |
putAll(Map map)
Deprecated. |
Object |
remove(Object key)
Deprecated. |
int |
size()
Deprecated. |
String |
toString()
Deprecated. |
Collection |
values()
Deprecated. |
| Methods inherited from class java.lang.Object |
|
| Methods inherited from interface java.util.Map |
hashCode |
| Constructor Detail |
public RefKeyMap()
RefKeyMap (new HashMap ()).public RefKeyMap(Map map)
LinkedHashMap,
the values method of this map will return values in
insertion order.| Method Detail |
public boolean makeHard(Object key)
RefMapConcurrentModificationExceptions being thrown by any
iterator in use while this method is called.makeHard in interface RefMapserp.util.RefMappublic boolean makeReference(Object key)
RefMapConcurrentModificationExceptions being thrown by any
iterator in use while this method is called.makeReference in interface RefMapserp.util.RefMappublic void clear()
clear in interface Mappublic boolean containsKey(Object key)
containsKey in interface Mappublic boolean containsValue(Object value)
containsValue in interface Mappublic Set entrySet()
entrySet in interface Mappublic boolean equals(Object other)
equals in interface Mapequals in class Objectpublic Object get(Object key)
get in interface Mappublic boolean isEmpty()
isEmpty in interface Mappublic Set keySet()
keySet in interface Map
public Object put(Object key,
Object value)
put in interface Mappublic void putAll(Map map)
putAll in interface Mappublic Object remove(Object key)
remove in interface Mappublic int size()
size in interface Mappublic Collection values()
values in interface Mappublic String toString()
toString in class Object
protected abstract RefKeyMap.RefMapKey createRefMapKey(Object key,
ReferenceQueue queue,
boolean identity)
Object.equals(java.lang.Object),
Object.hashCode() and Comparable.compareTo(java.lang.Object) methods will
be delegated to the given key value.key - the key value to hold; will not be nullqueue - the reference queue to place the reference in, or
null if the reference should not be placed in
a queueidentity - if true, the Object.equals(java.lang.Object) and
Object.hashCode() methods of the returned
reference should work by the JVM identity of the
key, not its corresponding methods
|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||