equal
deleted
inserted
replaced
111 = anAssociation |
111 = anAssociation |
112 "return true if the receiver equals the argument. |
112 "return true if the receiver equals the argument. |
113 Notice, that this compares both key AND value. |
113 Notice, that this compares both key AND value. |
114 Time will show if this is ok." |
114 Time will show if this is ok." |
115 |
115 |
116 self species == anAssociation species ifTrue:[ |
116 ^ self species == anAssociation species |
117 (anAssociation key = key) ifTrue:[ |
117 and:[anAssociation key = key and:[anAssociation value = value]] |
118 ^ anAssociation value = value |
|
119 ] |
|
120 ]. |
|
121 ^ false |
|
122 ! |
118 ! |
123 |
119 |
124 hash |
120 hash |
125 "return an integer useful for hashing on the receiver; |
121 "return an integer useful for hashing on the receiver; |
126 redefined since = is redefined here." |
122 redefined since = is redefined here." |
138 This method allows for any object to be displayed in some view |
134 This method allows for any object to be displayed in some view |
139 (although the fallBack is to display its printString ...)" |
135 (although the fallBack is to display its printString ...)" |
140 |
136 |
141 "/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
137 "/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
142 "/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
138 "/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
143 (aGCOrStream isStream and:[aGCOrStream ~~ Transcript]) ifFalse:[ |
139 (aGCOrStream isStream) ifFalse:[ |
144 ^ super displayOn:aGCOrStream |
140 ^ super displayOn:aGCOrStream |
145 ]. |
141 ]. |
146 |
142 |
147 key displayOn:aGCOrStream. |
143 key displayOn:aGCOrStream. |
148 aGCOrStream nextPutAll:'->'. |
144 aGCOrStream nextPutAll:'->'. |
182 ! ! |
178 ! ! |
183 |
179 |
184 !Association class methodsFor:'documentation'! |
180 !Association class methodsFor:'documentation'! |
185 |
181 |
186 version |
182 version |
187 ^ '$Header: /cvs/stx/stx/libbasic/Association.st,v 1.24 2012-04-24 12:00:50 stefan Exp $' |
183 ^ '$Header: /cvs/stx/stx/libbasic/Association.st,v 1.26 2014-07-11 09:55:51 stefan Exp $' |
188 ! |
184 ! |
189 |
185 |
190 version_CVS |
186 version_CVS |
191 ^ '$Header: /cvs/stx/stx/libbasic/Association.st,v 1.24 2012-04-24 12:00:50 stefan Exp $' |
187 ^ '$Header: /cvs/stx/stx/libbasic/Association.st,v 1.26 2014-07-11 09:55:51 stefan Exp $' |
192 ! ! |
188 ! ! |
|
189 |