Squeak Class Documentation category index | class index  
 
WeakRegistry
  category: Collections-Weak
  superclass: Collection
  subclasses:

I am a registry for objects needing finalization. When an object is added the object as well as its executor is stored. When the object is garbage collected, the executor can take the appropriate action for any resources associated with the object.

See also:
Object executor
Object actAsExecutor
Object finalize

instance methods
  accessing
  size
species

  adding
  add:

  enumerating
  do:

  finalization
  finalizeValues

  initialize
  initialize:

  printing
  printElementsOn:

  private
  protected:

  removing
  remove:ifAbsent:

class methods
  instance creation
  new
new:

instance methods
  accessing top  
 

size

Answer how many elements the receiver contains.


 

species

Answer the preferred class for reconstructing the receiver. For example,
collections create new collections whenever enumeration messages such as
collect: or select: are invoked. The new kind of collection is determined by
the species of the original collection. Species and class are not always the
same. For example, the species of Interval is Array.


  adding top  
 

add:

Add anObject to the receiver. Store the object as well as the associated executor.


  enumerating top  
 

do:

Evaluate aBlock with each of the receiver's elements as the argument.


  finalization top  
 

finalizeValues

Some of our elements may have gone away. Look for those and activate the associated executors.


  initialize top  
 

initialize:


  printing top  
 

printElementsOn:


  private top  
 

protected:

Execute aBlock protected by the accessLock


  removing top  
 

remove:ifAbsent:

Remove oldObject as one of the receiver's elements.


class methods
  instance creation top  
 

new

Answer a new instance of the receiver (which is a class) with no indexable variables. Fail if the class is indexable.


 

new:

Answer an instance of this class with the number of indexable
variables specified by the argument, sizeRequested.