serp.util
Class SoftCollection
java.lang.Object
|
+--serp.util.RefValueCollection
|
+--serp.util.SoftCollection
- All Implemented Interfaces:
- Collection, RefCollection
Deprecated. Replaced by the ReferenceCollection
.
- public class SoftCollection
- extends RefValueCollection
Collection implementation in which the values are held as soft
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:
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.
Constructor Summary |
SoftCollection()
Deprecated. Equivalent to SoftCollection (new LinkedList ()) . |
SoftCollection(Collection coll)
Deprecated. Construct a SoftCollection with the given interal collection. |
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 |
SoftCollection
public SoftCollection()
- Deprecated.
- Equivalent to
SoftCollection (new LinkedList ())
.
SoftCollection
public SoftCollection(Collection coll)
- Deprecated.
- Construct a SoftCollection 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.
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 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
value, not its corresponding methods
Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.