Previous: , Up: MappedCollection   [Index]


1.108.2 MappedCollection: basic

add: anObject

This method should not be called for instances of this class.

at: key

Answer the object at the given key

at: key put: value

Store value at the given key

atAll: keyCollection

Answer a new MappedCollection that only includes the given keys. The new MappedCollection might use keyCollection or consecutive integers for the keys, depending on the map’s type. Fail if any of them is not found in the map.

collect: aBlock

Answer a Collection with the same keys as the map, where accessing a key yields the value obtained by passing through aBlock the value accessible from the key in the receiver. The result need not be another MappedCollection

contents

Answer a bag with the receiver’s values

copyFrom: a to: b

Answer a new collection containing all the items in the receiver from the a-th to the b-th.

do: aBlock

Evaluate aBlock for each object

domain

Answer the receiver’s domain

keys

Answer the keys that can be used to access this collection.

keysAndValuesDo: aBlock

Evaluate aBlock passing two arguments, one being a key that can be used to access this collection, and the other one being the value.

keysDo: aBlock

Evaluate aBlock on the keys that can be used to access this collection.

map

Answer the receiver’s map

reject: aBlock

Answer the objects in the domain for which aBlock returns false

select: aBlock

Answer the objects in the domain for which aBlock returns true

size

Answer the receiver’s size


Previous: , Up: MappedCollection   [Index]