SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

serp.util
Class RefValueCollection

java.lang.Object
  |
  +--serp.util.RefValueCollection
All Implemented Interfaces:
Collection, RefCollection
Direct Known Subclasses:
SoftCollection, WeakCollection

Deprecated. Replaced by the ReferenceCollection.

abstract class RefValueCollection
extends Object
implements RefCollection

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

Subclasses must define the createRefValue(java.lang.Object, java.lang.ref.ReferenceQueue, boolean) method only. Expired values are removed from the collection before any mutator methods; removing before accessor methods can lead to ConcurrentModificationExceptions. 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 MapSets using identity hashing, which is supported. Performance is similar to that of the internal collection instance.


Inner Class Summary
(package private) static interface RefValueCollection.RefValue
          Deprecated. Represents a value held by weak or soft reference.
 
Constructor Summary
RefValueCollection()
          Deprecated. Equivalent to RefValueCollection (new LinkedList ()).
RefValueCollection(Collection coll)
          Deprecated. Construct a RefCollection with the given interal collection.
 
Method Summary
 boolean add(Object obj)
          Deprecated.  
 boolean add(Object obj, boolean hard)
          Deprecated. Add an object, with the option of adding it initially as a hard reference.
 boolean addAll(Collection objs)
          Deprecated.  
 boolean addAll(Collection objs, boolean hard)
          Deprecated. Add objects, with the option of adding them initially as hard references.
 void clear()
          Deprecated.  
 boolean contains(Object obj)
          Deprecated.  
 boolean containsAll(Collection objs)
          Deprecated.  
protected abstract  RefValueCollection.RefValue createRefValue(Object value, ReferenceQueue queue, boolean identity)
          Deprecated. Create a weak or soft reference to hold the given value.
 boolean equals(Object other)
          Deprecated.  
 boolean isEmpty()
          Deprecated.  
 Iterator iterator()
          Deprecated.  
 boolean makeHard(Object obj)
          Deprecated. Harden the reference for the given value.
 boolean makeReference(Object obj)
          Deprecated. Soften the reference for the given value.
 boolean remove(Object obj)
          Deprecated.  
 boolean removeAll(Collection objs)
          Deprecated.  
 boolean retainAll(Collection objs)
          Deprecated.  
 int size()
          Deprecated.  
 Object[] toArray()
          Deprecated.  
 Object[] toArray(Object[] a)
          Deprecated.  
 
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

RefValueCollection

public RefValueCollection()
Deprecated. 
Equivalent to RefValueCollection (new LinkedList ()).

RefValueCollection

public RefValueCollection(Collection coll)
Deprecated. 
Construct a RefCollection 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

makeHard

public boolean makeHard(Object obj)
Deprecated. 
Description copied from interface: RefCollection
Harden the reference for the given value. This will ensure that the value is not garbage collected. Note that this is a mutator method and can result in ConcurrentModificationExceptions being thrown by any iterator in use while this method is called.
Specified by:
makeHard in interface RefCollection
Following copied from interface: serp.util.RefCollection
Returns:
true if the reference to the value is now hard; false if the value does not exist in the collection (or has already expired)

makeReference

public boolean makeReference(Object obj)
Deprecated. 
Description copied from interface: RefCollection
Soften the reference for the given value. This will allow the value to be expired from the collection and garbage collected. This is the default for all new values added to the collection. Note that this is a mutator method and can result in ConcurrentModificationExceptions being thrown by any iterator in use while this method is called.
Specified by:
makeReference in interface RefCollection
Following copied from interface: serp.util.RefCollection
Returns:
true if the reference to the value is now soft; false if the value does not exist in the collection or cannot be maintained in a reference (as for nuill values)

add

public boolean add(Object obj)
Deprecated. 
Specified by:
add in interface Collection

add

public boolean add(Object obj,
                   boolean hard)
Deprecated. 
Description copied from interface: RefCollection
Add an object, with the option of adding it initially as a hard reference.
Specified by:
add in interface RefCollection

addAll

public boolean addAll(Collection objs)
Deprecated. 
Specified by:
addAll in interface Collection

addAll

public boolean addAll(Collection objs,
                      boolean hard)
Deprecated. 
Description copied from interface: RefCollection
Add objects, with the option of adding them initially as hard references.
Specified by:
addAll in interface RefCollection

clear

public void clear()
Deprecated. 
Specified by:
clear in interface Collection

contains

public boolean contains(Object obj)
Deprecated. 
Specified by:
contains in interface Collection

containsAll

public boolean containsAll(Collection objs)
Deprecated. 
Specified by:
containsAll in interface Collection

equals

public boolean equals(Object other)
Deprecated. 
Specified by:
equals in interface Collection
Overrides:
equals in class Object

isEmpty

public boolean isEmpty()
Deprecated. 
Specified by:
isEmpty in interface Collection

remove

public boolean remove(Object obj)
Deprecated. 
Specified by:
remove in interface Collection

removeAll

public boolean removeAll(Collection objs)
Deprecated. 
Specified by:
removeAll in interface Collection

retainAll

public boolean retainAll(Collection objs)
Deprecated. 
Specified by:
retainAll in interface Collection

size

public int size()
Deprecated. 
Specified by:
size in interface Collection

toArray

public Object[] toArray()
Deprecated. 
Specified by:
toArray in interface Collection

toArray

public Object[] toArray(Object[] a)
Deprecated. 
Specified by:
toArray in interface Collection

iterator

public Iterator iterator()
Deprecated. 
Specified by:
iterator in interface Collection

createRefValue

protected abstract RefValueCollection.RefValue createRefValue(Object value,
                                                              ReferenceQueue queue,
                                                              boolean identity)
Deprecated. 
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.
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

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

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