Overview | Package | Class | Tree | Deprecated | Index | Help
| 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

## serp.util
Class SoftKeyMap

    java.lang.Object
      |
      +--serp.util.RefKeyMap
            |
            +--serp.util.SoftKeyMap

All Implemented Interfaces:
  Map, RefMap

Deprecated. Replaced by the `ReferenceMap`.

public class SoftKeyMap
extends RefKeyMap

Map implementation in which the keys are held as soft references.

Expired values are removed from the map before any mutator methods; removing before accessor methods can lead to `ConcurrentModificationException`s. Thus, the following methods may produce results which include key/value pairs that have expired:

- `size`
- `isEmpty`
- `containsKey`
- `keySet.size,contains,isEmpty`
- `entrySet.size,contains,isEmpty`
- `values.size,contains,isEmpty`

By 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 classes inherited from class serp.util.RefKeyMap
`RefKeyMap.RefMapKey`

Inner classes inherited from class java.util.Map
`Map.Entry`

Constructor Summary
`SoftKeyMap()` Deprecated. Equivalent to `SoftKeyMap (new HashMap ())`.
`SoftKeyMap(Map map)` Deprecated. Construct a SoftKeyMap with the given interal map.

Method Summary
`protected RefKeyMap.RefMapKey` | `createRefMapKey(Object key, ReferenceQueue queue, boolean identity)` Deprecated. Create a weak or soft reference to hold the given key.

Methods inherited from class serp.util.RefKeyMap
`clear, containsKey, containsValue, entrySet, equals, get, isEmpty, keySet, makeHard, makeReference, put, putAll, remove, size, toString, values`

Methods inherited from class java.lang.Object
`, clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.Map
`hashCode`

Constructor Detail

### SoftKeyMap

    public SoftKeyMap()

  Deprecated.
  Equivalent to `SoftKeyMap (new HashMap ())`.

### SoftKeyMap

    public SoftKeyMap(Map map)

  Deprecated.
  Construct a SoftKeyMap with the given interal map. The internal map will be cleared. It should not be accessed in any way after being given to this constructor; this Map will 'inherit' its behavior, however. For example, if the given map is a `LinkedHashMap`, the `values` method of this map will return values in insertion order.

Method Detail

### createRefMapKey

    protected RefKeyMap.RefMapKey createRefMapKey(Object key,
                                                  ReferenceQueue queue,
                                                  boolean identity)

  Deprecated.
  Description copied from class: `RefKeyMap`
  Create a weak or soft reference to hold the given key. In general, the returned reference should guarantee that its `Object.equals(java.lang.Object)`, `Object.hashCode()` and `Comparable.compareTo(java.lang.Object)` methods will be delegated to the given key value.
  Overrides:
    `createRefMapKey` in class `RefKeyMap`
  Following copied from class: `serp.util.RefKeyMap`
  Parameters:
    `key` - the key value to hold; will not be null
    `queue` - the reference queue to place the reference in, or null if the reference should not be placed in a queue
    `identity` - 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

Overview | Package | Class | Tree | Deprecated | Index | Help
| 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

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.