Next: , Previous: , Up: WeakArray   [Index]


1.215.2 WeakArray: accessing

aliveObjectsDo: aBlock

Evaluate aBlock for all the elements in the array, excluding the garbage collected ones. Note: a finalized object stays alive until the next collection (the collector has no means to see whether it was resuscitated by the finalizer), so an object being alive does not mean that it is usable.

at: index

Answer the index-th item of the receiver, or nil if it has been garbage collected.

at: index put: object

Store the value associated to the given index; plus, store in nilValues whether the object is nil. nil objects whose associated item of nilValues is 1 were touched by the garbage collector.

atAll: indices put: object

Put object at every index contained in the indices collection

atAllPut: object

Put object at every index in the receiver

clearGCFlag: index

Clear the ‘object has been garbage collected’ flag for the item at the given index

do: aBlock

Evaluate aBlock for all the elements in the array, including the garbage collected ones (pass nil for those).

isAlive: index

Answer whether the item at the given index is still alive or has been garbage collected. Note: a finalized object stays alive until the next collection (the collector has no means to see whether it was resuscitated by the finalizer), so an object being alive does not mean that it is usable.

size

Answer the number of items in the receiver


Next: , Previous: , Up: WeakArray   [Index]