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 RefValueMap

    java.lang.Object
      |
      +--serp.util.RefValueMap

All Implemented Interfaces:
  Map, RefMap

Direct Known Subclasses:
  SoftValueMap, WeakValueMap

Deprecated. Replaced by the `ReferenceMap`.

abstract class RefValueMap
extends Object
implements RefMap

Abstract base class for maps whose values are stored as weak or soft references.

Subclasses must define the `createRefMapValue(java.lang.Object, java.lang.Object, java.lang.ref.ReferenceQueue)` method only. 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 hashing algorithm, ordering, etc of the given map will be preserved. Performance is similar to that of the internal map instance.

Inner Class Summary
`(package private) static interface` | `RefValueMap.RefMapValue` Deprecated. Interface representing a map entry whose value is stored using a weak or soft reference.

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

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

Method Summary
`void` | `clear()` Deprecated.
`boolean` | `containsKey(Object key)` Deprecated.
`boolean` | `containsValue(Object value)` Deprecated.
`protected abstract RefValueMap.RefMapValue` | `createRefMapValue(Object key, Object value, ReferenceQueue queue)` Deprecated. Create a weak or soft reference to hold the given value.
`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.
`protected void` | `removedReference(Object key)` Deprecated. Invoked when removing references from the reference queue.
`int` | `size()` Deprecated.
`String` | `toString()` Deprecated.
`Collection` | `values()` Deprecated.

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

### RefValueMap

    public RefValueMap()

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

### RefValueMap

    public RefValueMap(Map map)

  Deprecated.
  Construct a RefValueMap 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

### makeHard

    public boolean makeHard(Object key)

  Deprecated.
  Description copied from interface: `RefMap`
  Harden the reference for the given key. This will ensure that the key and the value it corresponds to are not garbage collected. Note that this is a mutator method and can result in `ConcurrentModificationException`s being thrown by any iterator in use while this method is called.
  Specified by:
    `makeHard` in interface `RefMap`
  Following copied from interface: `serp.util.RefMap`
  Returns:
    true if the reference to the key is now hard; false if the key does not exist in the map (or has already expired)

### makeReference

    public boolean makeReference(Object key)

  Deprecated.
  Description copied from interface: `RefMap`
  Soften the reference for the given key. This will allow the key and the value it corresponds to can be expired from the map, and the key/value garbage collected. This is the default for all new key/ value pairs added to the map. Note that this is a mutator method and can result in `ConcurrentModificationException`s being thrown by any iterator in use while this method is called.
  Specified by:
    `makeReference` in interface `RefMap`
  Following copied from interface: `serp.util.RefMap`
  Returns:
    true if the reference to the key/value is now soft; false if the key does not exist or the key/value cannot be maintained in a reference (as for nuill values)

### clear

    public void clear()

  Deprecated.
  Specified by:
    `clear` in interface `Map`

### containsKey

    public boolean containsKey(Object key)

  Deprecated.
  Specified by:
    `containsKey` in interface `Map`

### containsValue

    public boolean containsValue(Object value)

  Deprecated.
  Specified by:
    `containsValue` in interface `Map`

### entrySet

    public Set entrySet()

  Deprecated.
  Specified by:
    `entrySet` in interface `Map`

### equals

    public boolean equals(Object other)

  Deprecated.
  Specified by:
    `equals` in interface `Map`
  Overrides:
    `equals` in class `Object`

### get

    public Object get(Object key)

  Deprecated.
  Specified by:
    `get` in interface `Map`

### isEmpty

    public boolean isEmpty()

  Deprecated.
  Specified by:
    `isEmpty` in interface `Map`

### keySet

    public Set keySet()

  Deprecated.
  Specified by:
    `keySet` in interface `Map`

### put

    public Object put(Object key,
                      Object value)

  Deprecated.
  Specified by:
    `put` in interface `Map`

### putAll

    public void putAll(Map map)

  Deprecated.
  Specified by:
    `putAll` in interface `Map`

### remove

    public Object remove(Object key)

  Deprecated.
  Specified by:
    `remove` in interface `Map`

### size

    public int size()

  Deprecated.
  Specified by:
    `size` in interface `Map`

### values

    public Collection values()

  Deprecated.
  Specified by:
    `values` in interface `Map`

### toString

    public String toString()

  Deprecated.
  Overrides:
    `toString` in class `Object`

### createRefMapValue

    protected abstract RefValueMap.RefMapValue createRefMapValue(Object key,
                                                                 Object value,
                                                                 ReferenceQueue queue)

  Deprecated.
  Create a weak or soft reference to hold the given value.

### removedReference

    protected void removedReference(Object key)

  Deprecated.
  Invoked when removing references from the reference queue. `key` is the key whose value has expired.

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.