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 WeakCollection

    java.lang.Object
      |
      +--serp.util.RefValueCollection
            |
            +--serp.util.WeakCollection

All Implemented Interfaces:
  Collection, RefCollection

Deprecated. Replaced by the `ReferenceCollection`.

public class WeakCollection
extends RefValueCollection

Collection implementation in which the values are held as weak references.

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

- `size`
- `isEmpty`

By default, all methods are delegated to the internal collection provided at construction. Thus, the ordering, etc of the given collection will be preserved. A special case is also made for `MapSet`s using identity hashing, which is supported.

Performance is similar to that of the internal collection instance.

Inner classes inherited from class serp.util.RefValueCollection
`RefValueCollection.RefValue`

Constructor Summary
`WeakCollection()` Deprecated. Equivalent to `WeakCollection (new LinkedList ())`.
`WeakCollection(Collection coll)` Deprecated. Construct a WeakCollection with the given interal collection.

Method Summary
`protected RefValueCollection.RefValue` | `createRefValue(Object value, ReferenceQueue queue, boolean identity)` Deprecated. Create a weak or soft reference to hold the given value.

Methods inherited from class serp.util.RefValueCollection
`add, add, addAll, addAll, clear, contains, containsAll, equals, isEmpty, iterator, makeHard, makeReference, remove, removeAll, retainAll, size, toArray, toArray`

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

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

Constructor Detail

### WeakCollection

    public WeakCollection()

  Deprecated.
  Equivalent to `WeakCollection (new LinkedList ())`.

### WeakCollection

    public WeakCollection(Collection coll)

  Deprecated.
  Construct a WeakCollection with the given interal collection. The internal collection will be cleared. It should not be accessed in any way after being given to this constructor; this collection will 'inherit' its behavior, however. For example, if the given collection is a `TreeSet`, the elements will be maintained in natural order and will not allow duplicates.

Method Detail

### createRefValue

    protected RefValueCollection.RefValue createRefValue(Object value,
                                                         ReferenceQueue queue,
                                                         boolean identity)

  Deprecated.
  Description copied from class: `RefValueCollection`
  Create a weak or soft reference to hold the given value. In general, the returned reference should guarantee that its `Object.equals(java.lang.Object)`, `Object.hashCode()`, and {#link Comparable#compareTo} methods will be delegated to the given value.
  Overrides:
    `createRefValue` in class `RefValueCollection`
  Following copied from class: `serp.util.RefValueCollection`
  Parameters:
    `value` - the 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 value, 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.