equal
deleted
inserted
replaced
32 |
32 |
33 ^ properties notNil and: [ properties includesKey: aKey ] |
33 ^ properties notNil and: [ properties includesKey: aKey ] |
34 ! |
34 ! |
35 |
35 |
36 keysAndValuesDo: aBlock |
36 keysAndValuesDo: aBlock |
37 properties ifNil: [ ^ self ]. |
37 properties isNil ifTrue: [ ^ self ]. |
38 properties keysAndValuesDo: [ :key :value | aBlock value: key value: value copy ] |
38 properties keysAndValuesDo: [ :key :value | aBlock value: key value: value copy ] |
39 ! |
39 ! |
40 |
40 |
41 propertiesSize |
41 propertiesSize |
42 properties ifNil: [ ^ 0 ]. |
42 properties isNil ifTrue: [ ^ 0 ]. |
43 ^ properties size. |
43 ^ properties size. |
44 ! |
44 ! |
45 |
45 |
46 propertyAt: aKey |
46 propertyAt: aKey |
47 "Answer the property value associated with aKey." |
47 "Answer the property value associated with aKey." |
69 ! |
69 ! |
70 |
70 |
71 propertyAt: aKey put: anObject |
71 propertyAt: aKey put: anObject |
72 "Set the property at aKey to be anObject. If aKey is not found, create a new entry for aKey and set is value to anObject. Answer anObject." |
72 "Set the property at aKey to be anObject. If aKey is not found, create a new entry for aKey and set is value to anObject. Answer anObject." |
73 |
73 |
74 ^ (properties ifNil: [ properties := Dictionary new: 1 ]) |
74 ^ (properties isNil ifTrue: [ properties := Dictionary new: 1 ]) |
75 at: aKey put: (anObject copy) |
75 at: aKey put: (anObject copy) |
76 ! |
76 ! |
77 |
77 |
78 removeProperty: aKey |
78 removeProperty: aKey |
79 "Remove the property with aKey. Answer the property or raise an error if aKey isn't found." |
79 "Remove the property with aKey. Answer the property or raise an error if aKey isn't found." |