com.sun.electric.database.text
Class WeakReferences<E>

java.lang.Object
  extended by com.sun.electric.database.text.WeakReferences<E>

public class WeakReferences<E>
extends java.lang.Object

A pool of weak reference objects, which do not prevent their referents from being made finalizable, finalized, and then reclaimed. This class may be used for keeping a pool of some Listeners. This class is not synchronized


Constructor Summary
WeakReferences()
          Constructs an empty pool.
 
Method Summary
 boolean add(E o)
          Appends the specified element to the pool.
 java.util.Iterator<E> iterator()
          Returns an iterator over live elements in this pool in proper sequence.
 boolean remove(E o)
          Removes a single instance of the specified element from this list, if it is present (optional operation).
 java.util.Iterator<E> reverseIterator()
          Returns an iterator over live elements in this pool in reverse sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakReferences

public WeakReferences()
Constructs an empty pool.

Method Detail

add

public boolean add(E o)
Appends the specified element to the pool.

Parameters:
o - specified element.
Returns:
always true.

remove

public boolean remove(E o)
Removes a single instance of the specified element from this list, if it is present (optional operation). Also purges references whose referents are not alive.

Parameters:
o - speicified element.
Returns:
true if element was removed.

iterator

public java.util.Iterator<E> iterator()
Returns an iterator over live elements in this pool in proper sequence. Also purges refetences whose referents are not alive.

Returns:
an iterator over the elements in this pool in proper sequence.

reverseIterator

public java.util.Iterator<E> reverseIterator()
Returns an iterator over live elements in this pool in reverse sequence. Also purges refetences whose referents are not alive.

Returns:
an iterator over the elements in this pool in reverse sequence.