Back: WeakValueIdentityDictionary Up: Base classes Forward: WeakValueLookupTable class-hacks   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.215 WeakValueLookupTable

Defined in namespace Smalltalk
Superclass: LookupTable
Category: Collections-Weak

I am similar to a plain LookupTable, but my values are stored in a weak array; I track which of the values are garbage collected and, as soon as one of them is accessed, I swiftly remove the associations for the garbage collected values

1.215.1 WeakValueLookupTable class: hacks  (class)
1.215.2 WeakValueLookupTable: enumerating  (instance)
1.215.3 WeakValueLookupTable: hacks  (instance)
1.215.4 WeakValueLookupTable: printing  (instance)
1.215.5 WeakValueLookupTable: rehashing  (instance)


1.215.1 WeakValueLookupTable class: hacks

primNew: realSize
Answer a new, uninitialized instance of the receiver with the given size


1.215.2 WeakValueLookupTable: enumerating

do: aBlock
Pass each value in the LookupTable to aBlock.

keysDo: aBlock
Pass each key in the LookupTable to aBlock.


1.215.3 WeakValueLookupTable: hacks

at: key ifAbsent: aBlock
Answer the value associated to the given key, or the result of evaluating aBlock if the key is not found

at: key ifPresent: aBlock
If aKey is absent, answer nil. Else, evaluate aBlock passing the associated value and answer the result of the invocation

includesKey: key
Answer whether the receiver contains the given key.


1.215.4 WeakValueLookupTable: printing

examineOn: aStream
Print all the instance variables and objects in the receiver on aStream


1.215.5 WeakValueLookupTable: rehashing

rehash
Rehash the receiver



Back: WeakValueLookupTable-printing Up: WeakValueLookupTable Forward: WordArray   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on February, 22 2012 using texi2html