author | Stefan Vogel <sv@exept.de> |
Mon, 08 Jun 2015 17:51:54 +0200 | |
changeset 18463 | 8c5f3917b2e8 |
parent 16765 | 72c7f90b2c4d |
child 18465 | e9e4bb62235f |
permissions | -rw-r--r-- |
15133 | 1 |
" |
2 |
COPYRIGHT. |
|
3 |
This is a Manchester Goodie protected by copyright. |
|
4 |
These conditions are imposed on the whole Goodie, and on any significant |
|
5 |
part of it which is separately transmitted or stored: |
|
6 |
* You must ensure that every copy includes this notice, and that |
|
7 |
source and author(s) of the material are acknowledged. |
|
8 |
* These conditions must be imposed on anyone who receives a copy. |
|
9 |
* The material shall not be used for commercial gain without the prior |
|
10 |
written consent of the author(s). |
|
11 |
Further information on the copyright conditions may be obtained by |
|
12 |
sending electronic mail: |
|
13 |
To: goodies-lib@cs.man.ac.uk |
|
14 |
Subject: copyright |
|
15 |
or by writing to The Smalltalk Goodies Library Manager, Dept of |
|
16 |
Computer Science, The University, Manchester M13 9PL, UK |
|
17 |
||
18 |
(C) Copyright 1992 University of Manchester |
|
19 |
For more information about the Manchester Goodies Library (from which |
|
20 |
this file was distributed) send e-mail: |
|
21 |
To: goodies-lib@cs.man.ac.uk |
|
22 |
Subject: help |
|
23 |
" |
|
15134
84e886ef6b5f
Packet change libbasic2 -> libbasic
Stefan Vogel <sv@exept.de>
parents:
15133
diff
changeset
|
24 |
"{ Package: 'stx:libbasic' }" |
15133 | 25 |
|
26 |
Dictionary subclass:#OrderedDictionary |
|
27 |
instanceVariableNames:'order' |
|
28 |
classVariableNames:'' |
|
29 |
poolDictionaries:'' |
|
30 |
category:'Collections-Sequenceable' |
|
31 |
! |
|
32 |
||
33 |
!OrderedDictionary class methodsFor:'documentation'! |
|
34 |
||
35 |
copyright |
|
36 |
" |
|
37 |
COPYRIGHT. |
|
38 |
This is a Manchester Goodie protected by copyright. |
|
39 |
These conditions are imposed on the whole Goodie, and on any significant |
|
40 |
part of it which is separately transmitted or stored: |
|
41 |
* You must ensure that every copy includes this notice, and that |
|
42 |
source and author(s) of the material are acknowledged. |
|
43 |
* These conditions must be imposed on anyone who receives a copy. |
|
44 |
* The material shall not be used for commercial gain without the prior |
|
45 |
written consent of the author(s). |
|
46 |
Further information on the copyright conditions may be obtained by |
|
47 |
sending electronic mail: |
|
48 |
To: goodies-lib@cs.man.ac.uk |
|
49 |
Subject: copyright |
|
50 |
or by writing to The Smalltalk Goodies Library Manager, Dept of |
|
51 |
Computer Science, The University, Manchester M13 9PL, UK |
|
52 |
||
53 |
(C) Copyright 1992 University of Manchester |
|
54 |
For more information about the Manchester Goodies Library (from which |
|
55 |
this file was distributed) send e-mail: |
|
56 |
To: goodies-lib@cs.man.ac.uk |
|
57 |
Subject: help |
|
58 |
" |
|
59 |
! |
|
60 |
||
61 |
documentation |
|
62 |
" |
|
63 |
I am a subclass of Dictionary whose elements (associations) are ordered in a |
|
64 |
similar fashion to OrderedCollection. |
|
65 |
That is, while being filled via #at:put: messages (or similar Dictionary protocol), |
|
66 |
the order in which associations are added is remembered and accessable via the #atIndex: |
|
67 |
or #order messages. |
|
68 |
||
69 |
I have one instance variable: |
|
70 |
||
71 |
order <OrderedCollection> Ordered collection of keys reflecting the order of |
|
72 |
associations in the dictionary. |
|
73 |
||
74 |
[author:] |
|
75 |
Ifor Wyn Williams <ifor@uk.ac.man.cs> |
|
15801 | 76 |
Changed by: exept |
15133 | 77 |
|
78 |
[see also:] |
|
79 |
OrderedCollection Dictionary |
|
80 |
OrderedSet |
|
81 |
" |
|
82 |
! |
|
83 |
||
84 |
examples |
|
85 |
" |
|
86 |
|o| |
|
87 |
||
88 |
o := OrderedDictionary new. |
|
89 |
||
90 |
o at:'one' put:1. |
|
91 |
o at:'two' put:2. |
|
92 |
o at:'three' put:3. |
|
93 |
o at:'four' put:4. |
|
94 |
o at:'five' put:5. |
|
95 |
o at:'six' put:6. |
|
96 |
o at:'seven' put:7. |
|
97 |
o at:'eight' put:8. |
|
98 |
o at:'nine' put:9. |
|
99 |
o at:'zero' put:0. |
|
100 |
||
101 |
o at:'eight'. |
|
102 |
o atIndex:1. |
|
103 |
o atIndex:5. |
|
104 |
o atIndex:10. |
|
105 |
||
106 |
o from:3 to:6 do:[:each | Transcript showCR:each ]. |
|
107 |
||
108 |
o collect:[:eachAssoc | eachAssoc key -> eachAssoc value squared]. |
|
109 |
o associations. |
|
110 |
o order. |
|
111 |
o reverse. |
|
112 |
||
113 |
o atIndex:1. |
|
114 |
o atIndex:5. |
|
115 |
o atIndex:10. |
|
116 |
" |
|
117 |
! |
|
118 |
||
119 |
info |
|
120 |
" |
|
121 |
NAME OrderedDictionary |
|
122 |
AUTHOR Ifor Wyn Williams <ifor@uk.ac.man.cs> |
|
123 |
CONTRIBUTOR Ifor Wyn Williams <ifor@uk.ac.man.cs> |
|
124 |
FUNCTION An ordered dictionary |
|
125 |
ST-VERSIONS 2.3-5, 4.0 |
|
126 |
PREREQUISITES |
|
127 |
CONFLICTS |
|
128 |
DISTRIBUTION global |
|
129 |
VERSION 1.2 |
|
130 |
DATE 28.3.90 |
|
131 |
SUMMARY A dictionary that behaves like a SequencableCollection |
|
132 |
(except that associations cannot be removed). |
|
133 |
" |
|
134 |
! ! |
|
135 |
||
136 |
!OrderedDictionary class methodsFor:'instance creation'! |
|
137 |
||
138 |
new |
|
139 |
^ super new initializeOrder |
|
140 |
! |
|
141 |
||
142 |
new: anInteger |
|
143 |
^(super new: anInteger) initializeOrder |
|
144 |
! ! |
|
145 |
||
146 |
!OrderedDictionary methodsFor:'accessing'! |
|
147 |
||
15801 | 148 |
after:anAssociation |
15133 | 149 |
"Return the association after anAssociation in the order. |
15801 | 150 |
If anAssociation is the last association in the order, return nil. |
15133 | 151 |
If anAssociation is not found, invoke an error notifier" |
152 |
||
15801 | 153 |
|sz "{ Class:SmallInteger }"| |
154 |
||
155 |
sz := order size. |
|
156 |
1 to:sz do:[:index | |
|
157 |
(self associationAt:(order at:index)) = anAssociation ifTrue:[ |
|
158 |
index == sz ifTrue:[^ nil]. |
|
159 |
^ self associationAt:(order at:index + 1) |
|
160 |
] |
|
161 |
]. |
|
162 |
^ self errorNotFound:anAssociation. |
|
15133 | 163 |
! |
164 |
||
165 |
associations |
|
166 |
"Return an OrderedCollection containing the receiver's associations." |
|
167 |
||
168 |
^ order collect: [:key | self associationAt: key ]. |
|
169 |
! |
|
170 |
||
171 |
at:aKey ifAbsentPut:valueBlock |
|
15801 | 172 |
^ self at:aKey ifAbsent:[self at:aKey put:valueBlock value] |
15133 | 173 |
! |
174 |
||
15801 | 175 |
at:key put:anObject |
15133 | 176 |
"Set the value at key to be anObject. |
15759 | 177 |
If key is not found, create a new entry for key and set its value to anObject. |
15133 | 178 |
If key is already present, the order remains unchanged. |
179 |
Return anObject." |
|
180 |
||
15801 | 181 |
(self includesKey: key) ifFalse:[order add: key]. |
182 |
^ super at:key put:anObject |
|
15133 | 183 |
! |
184 |
||
185 |
atAll:indexCollection put: anObject |
|
186 |
"Put anObject into the value field of every association specified by indexCollection, |
|
187 |
which is typically an interval." |
|
188 |
||
189 |
indexCollection do:[:index | self at:(order at: index) put:anObject] |
|
190 |
! |
|
191 |
||
192 |
atAllPut: anObject |
|
193 |
"Put anObject into the value field of every association in the dictionary" |
|
194 |
||
15801 | 195 |
order do:[:key | super at: key put:anObject] |
15133 | 196 |
! |
197 |
||
198 |
atIndex:index |
|
199 |
"return an element at a given index" |
|
200 |
||
201 |
^ self at:(order at:index) |
|
202 |
||
203 |
"Created: 28.9.1995 / 13:49:39 / stefan" |
|
204 |
! |
|
205 |
||
15534 | 206 |
atIndex:index ifAbsent:aBlock |
207 |
"return an element at a given index" |
|
208 |
||
209 |
^ self at:(order at:index ifAbsent:[^ aBlock value]) |
|
210 |
! |
|
211 |
||
15133 | 212 |
atIndex:index put:anAssociation |
15801 | 213 |
"put an association to a given index. remove the old association at this index" |
15133 | 214 |
|key| |
215 |
||
216 |
key := anAssociation key. |
|
217 |
(super includesKey:key) ifTrue:[ |
|
218 |
^ self error:'duplicate key'. |
|
219 |
]. |
|
220 |
super removeKey:(order at:index) ifAbsent:[]. |
|
221 |
order at:index put:key. |
|
15801 | 222 |
super at:key put:anAssociation value. |
223 |
^ anAssociation. |
|
15133 | 224 |
|
225 |
"Created: 28.9.1995 / 16:30:15 / stefan" |
|
226 |
! |
|
227 |
||
15801 | 228 |
before:anAssociation |
15133 | 229 |
"Return the association before anAssociation in the order. |
15801 | 230 |
If anAssociation is the first association in the order, return nil. |
15133 | 231 |
If anAssociation is not found, invoke an error notifier" |
15801 | 232 |
|
233 |
|sz "{ Class:SmallInteger }"| |
|
15133 | 234 |
|
15801 | 235 |
sz := order size. |
236 |
1 to:sz do:[:index | |
|
237 |
(self associationAt:(order at:index)) = anAssociation ifTrue:[ |
|
238 |
index == 1 ifTrue:[^ nil]. |
|
239 |
^ self associationAt:(order at:index - 1) |
|
240 |
] |
|
15133 | 241 |
]. |
15801 | 242 |
^ self errorNotFound:anAssociation. |
15133 | 243 |
! |
244 |
||
245 |
first |
|
246 |
"Return the first association of the receiver. |
|
247 |
Provide an error notification if the receiver contains no elements." |
|
248 |
||
249 |
^ self associationAt: (order first) |
|
250 |
||
251 |
" |
|
252 |
OrderedDictionary new first |
|
253 |
" |
|
254 |
! |
|
255 |
||
256 |
keyAt:index |
|
257 |
"get the key at the given index" |
|
258 |
||
259 |
^ order at:index. |
|
260 |
||
261 |
" |
|
262 |
|s| |
|
263 |
||
264 |
s := OrderedDictionary new. |
|
265 |
s at:#a put:'aaa'; at:#b put:'bbb'; at:#c put:'ccc'; at:#d put:'ddd'; at:#a put:'aaaa'. |
|
266 |
s keyAt:2 |
|
267 |
" |
|
268 |
||
269 |
"Created: 29.9.1995 / 11:32:07 / stefan" |
|
270 |
! |
|
271 |
||
272 |
keys |
|
273 |
"Return a OrderedCollection containing the receiver's keys." |
|
274 |
||
275 |
^ order copy. |
|
276 |
||
277 |
" |
|
278 |
|s| |
|
279 |
||
280 |
s := OrderedDictionary new. |
|
281 |
s at:#a put:'aaa'; at:#b put:'bbb'; at:#c put:'ccc'; at:#d put:'ddd'; at:#a put:'aaaa'. |
|
282 |
s keys |
|
283 |
" |
|
284 |
! |
|
285 |
||
286 |
last |
|
287 |
"Return the last association of the receiver. |
|
288 |
Provide an error notification if the receiver contains no elements." |
|
289 |
||
290 |
^ self associationAt: (order last) |
|
291 |
||
292 |
" |
|
293 |
OrderedDictionary new last |
|
294 |
" |
|
295 |
! |
|
296 |
||
297 |
order |
|
298 |
"returns the keys in the order of their appearance" |
|
299 |
||
300 |
^ order |
|
301 |
||
302 |
" |
|
303 |
|s| |
|
304 |
||
305 |
s := OrderedDictionary new. |
|
306 |
s at:#a put:'aaa'; at:#b put:'bbb'; at:#c put:'ccc'; at:#d put:'ddd'; at:#a put:'aaaa'. |
|
307 |
s order |
|
308 |
" |
|
309 |
! |
|
310 |
||
311 |
valueAt:index |
|
312 |
"get the value at the given index" |
|
313 |
||
15801 | 314 |
^ self at:(order at:index). |
15133 | 315 |
|
316 |
" |
|
317 |
|s| |
|
318 |
||
319 |
s := OrderedDictionary new. |
|
320 |
s at:#a put:'aaa'; at:#b put:'bbb'; at:#c put:'ccc'; at:#d put:'ddd'; at:#a put:'aaaa'. |
|
321 |
s valueAt:2 |
|
322 |
" |
|
323 |
! |
|
324 |
||
325 |
values |
|
326 |
"Return a OrderedCollection containing the receiver's values." |
|
327 |
||
15801 | 328 |
^ order collect:[:key | self at:key]. |
15133 | 329 |
! ! |
330 |
||
331 |
!OrderedDictionary methodsFor:'adding'! |
|
332 |
||
333 |
add: anAssociation after: oldAssociation |
|
334 |
"Add the argument, anAssociation, as an element of the dictionary. Put it |
|
335 |
in the position just succeeding oldAssociation. Return anAssociation." |
|
336 |
||
15801 | 337 |
| index key | |
15133 | 338 |
|
339 |
index := self indexOfAssociation: oldAssociation |
|
15801 | 340 |
ifAbsent: [^ self errorNotFound:anAssociation]. |
341 |
key := anAssociation key. |
|
342 |
order remove:key ifAbsent:[]. |
|
343 |
order add:key after:(order at: index). |
|
344 |
super at:key put:anAssociation value. |
|
15133 | 345 |
^ anAssociation |
346 |
! |
|
347 |
||
15801 | 348 |
add:anAssociation before:oldAssociation |
15133 | 349 |
"Add the argument, anAssociation, as an element of the dictionary. Put it |
350 |
in the position just preceding oldAssociation. Return anAssociation." |
|
351 |
||
15801 | 352 |
| index key | |
15133 | 353 |
|
354 |
index := self indexOfAssociation: oldAssociation |
|
15801 | 355 |
ifAbsent: [^ self errorNotFound:anAssociation]. |
356 |
key := anAssociation key. |
|
357 |
order remove:key ifAbsent:[]. |
|
358 |
order add:key before:(order at: index). |
|
359 |
super at:key put:anAssociation value. |
|
15133 | 360 |
^ anAssociation |
361 |
! |
|
362 |
||
15801 | 363 |
add:anAssociation beforeIndex:spot |
15133 | 364 |
"Add the argument, anAssociation, as an element of the receiver. Put it |
365 |
in the position just preceding the indexed position spot. Return newObject." |
|
366 |
||
15801 | 367 |
|key| |
368 |
||
369 |
key := anAssociation key. |
|
370 |
order remove:key ifAbsent:[]. |
|
371 |
order add:key beforeIndex:spot. |
|
372 |
super at:key put:anAssociation value. |
|
373 |
^ anAssociation |
|
15133 | 374 |
|
375 |
"Modified: 28.9.1995 / 14:06:53 / stefan" |
|
376 |
! |
|
377 |
||
378 |
addAll:aCollectionOfAssociations |
|
379 |
"Add each element of anOrderedCollectionOfAssociations at my end. |
|
380 |
We expect the argument to enumerate associations with #reverseDo:; |
|
381 |
if it does not (i.e. it is another OD or a dictionary), use #addAllAssociationsFirst:. |
|
382 |
Returns the argument, aCollectionOfAssociations (sigh)." |
|
383 |
||
15801 | 384 |
^ self addAllLast:aCollectionOfAssociations. |
15133 | 385 |
|
386 |
"Modified: 28.2.1997 / 15:51:23 / cg" |
|
387 |
! |
|
388 |
||
389 |
addAllAssociations:aDictionaryOrOrderedDictionary |
|
390 |
"Add each association of aDictionaryOrOrderedDictionary to my end. |
|
391 |
We expect the argument to respond to #associationsDo:." |
|
392 |
||
15801 | 393 |
^ self addAllAssociationsLast:aDictionaryOrOrderedDictionary. |
15133 | 394 |
|
395 |
"Created: 28.2.1997 / 15:52:02 / cg" |
|
396 |
! |
|
397 |
||
398 |
addAllAssociationsFirst:aDictionaryOrOrderedDictionary |
|
399 |
"Add each association of aDictionaryOrOrderedDictionary at the beginning of the |
|
400 |
receiver. We expect the argument to respond to #associationsReverseDo:." |
|
401 |
||
402 |
aDictionaryOrOrderedDictionary associationsReverseDo:[:each | self addFirst:each]. |
|
403 |
^ aDictionaryOrOrderedDictionary |
|
404 |
||
405 |
"Created: 28.2.1997 / 15:50:14 / cg" |
|
406 |
! |
|
407 |
||
408 |
addAllAssociationsLast:aDictionaryOrOrderedDictionary |
|
409 |
"Add each association of aDictionaryOrOrderedDictionary at the end of the |
|
410 |
receiver. We expect the argument to respond to #associationsDo:." |
|
411 |
||
412 |
aDictionaryOrOrderedDictionary associationsDo:[:each | self addLast:each]. |
|
413 |
^ aDictionaryOrOrderedDictionary |
|
414 |
||
415 |
"Created: 28.2.1997 / 15:48:37 / cg" |
|
416 |
! |
|
417 |
||
15801 | 418 |
addFirst:anAssociation |
15133 | 419 |
"Add anAssociation to the beginning of the receiver." |
420 |
||
15801 | 421 |
|key| |
422 |
||
423 |
key := anAssociation key. |
|
424 |
order remove:key ifAbsent:[]. |
|
425 |
order addFirst:key. |
|
426 |
super at:key put:anAssociation value. |
|
427 |
^ anAssociation |
|
15133 | 428 |
! |
429 |
||
15801 | 430 |
addLast:anAssociation |
15133 | 431 |
"Add anAssociation to the end of the receiver. |
432 |
If anAssociation is already present in the dictionary, |
|
433 |
it will be moved to the end. (See also: #add:)" |
|
434 |
||
15801 | 435 |
|key| |
436 |
||
437 |
key := anAssociation key. |
|
438 |
order remove:key ifAbsent:[]. |
|
439 |
order add:key. |
|
440 |
super at:key put:anAssociation value. |
|
441 |
^ anAssociation |
|
15133 | 442 |
! ! |
443 |
||
444 |
!OrderedDictionary methodsFor:'copying'! |
|
445 |
||
446 |
copyEmpty |
|
447 |
"Return a copy of the receiver that contains no elements." |
|
448 |
||
15801 | 449 |
^ self species new: 10 |
15133 | 450 |
! |
451 |
||
15801 | 452 |
copyFrom:startIndex to:endIndex |
15133 | 453 |
"Return a copy of the receiver that contains elements from |
454 |
position startIndex to endIndex." |
|
15801 | 455 |
|
456 |
|newDict| |
|
15133 | 457 |
|
15801 | 458 |
endIndex < startIndex ifTrue:[ |
459 |
^ self copyEmpty |
|
460 |
]. |
|
461 |
(startIndex < 1 or:[ endIndex > order size ]) ifTrue:[ |
|
462 |
^ self errorNotFound |
|
463 |
]. |
|
464 |
newDict := self copyEmpty:endIndex - startIndex + 1. |
|
465 |
startIndex to:endIndex do:[:index | |
|
466 |
newDict add:(self associationAt:(order at:index)) |
|
467 |
]. |
|
15133 | 468 |
^ newDict |
469 |
! |
|
470 |
||
471 |
copyWithout: anAssociation |
|
472 |
"Return a copy of the dictionary that is 1 smaller than the receiver and |
|
473 |
does not include the argument, anAssociation |
|
474 |
No error is reported, if elementToSkip is not in the collection." |
|
475 |
||
16765 | 476 |
| newDict keyToIgnore valueToIgnore| |
477 |
||
15801 | 478 |
newDict := self species new:order size - 1. |
16765 | 479 |
"/ self associationsDo:[:assoc | anAssociation = assoc ifFalse:[newDict add:assoc]]. |
480 |
||
481 |
keyToIgnore := anAssociation key. |
|
482 |
valueToIgnore := anAssociation value. |
|
483 |
self keysAndValuesDo:[:k :v | |
|
484 |
(keyToIgnore = k and:[valueToIgnore = v]) ifFalse:[ |
|
485 |
newDict at:k put:v |
|
486 |
] |
|
487 |
]. |
|
488 |
^ newDict. |
|
489 |
||
490 |
" |
|
491 |
|d d2| |
|
492 |
||
493 |
d := OrderedDictionary new |
|
494 |
at:1 put:'1'; |
|
495 |
at:2 put:'2'; |
|
496 |
at:3 put:'3'; |
|
497 |
at:4 put:'4'; |
|
498 |
at:5 put:'5'; |
|
499 |
yourself. |
|
500 |
d2 := d copyWithout:(4->'4'). |
|
501 |
d2 |
|
502 |
" |
|
15133 | 503 |
! |
504 |
||
505 |
postCopy |
|
506 |
"have to copy the order too" |
|
507 |
||
508 |
super postCopy. |
|
509 |
order := order copy |
|
510 |
! ! |
|
511 |
||
512 |
!OrderedDictionary methodsFor:'enumerating'! |
|
513 |
||
514 |
associationsCollect: aBlock |
|
515 |
"Evaluate aBlock with each of the associations of the dictionary as argument, |
|
516 |
and return a new (ordered) collection with the results" |
|
517 |
||
518 |
^ order collect:[:key | (aBlock value: (self associationAt:key))]. |
|
519 |
! |
|
520 |
||
521 |
associationsDo: aBlock |
|
16765 | 522 |
"Evaluate aBlock for each of the dictionary's associations. |
523 |
Enumerate them in the order by which they were added. |
|
524 |
||
525 |
See also: |
|
526 |
#keysAndValuesDo: (which passes keys & values separately) |
|
527 |
#keysDo: (which passes keys only) |
|
528 |
#do: (which passes values only)" |
|
15133 | 529 |
|
530 |
order do: [:key | aBlock value: (self associationAt: key)] |
|
531 |
! |
|
532 |
||
533 |
associationsDo: aBlock from: firstIndex to: secondIndex |
|
534 |
"Evaluate aBlock with each of the dictionary's associations from index |
|
535 |
firstIndex to index secondIndex as the argument." |
|
536 |
||
537 |
firstIndex to: secondIndex do: [:index | |
|
538 |
aBlock value: (self associationAt: (order at: index)) |
|
539 |
] |
|
540 |
! |
|
541 |
||
542 |
associationsReverseDo: aBlock |
|
543 |
"Evaluate aBlock for each of the dictionary's associations in reverse order." |
|
544 |
||
545 |
order reverseDo:[:key | aBlock value:(self associationAt:key)] |
|
546 |
||
547 |
"Created: 28.2.1997 / 15:52:31 / cg" |
|
548 |
! |
|
549 |
||
550 |
associationsSelect:aBlock |
|
551 |
"Evaluate aBlock with each of the dictionary's associations as the argument. |
|
552 |
Collect into a new OrderedDictionary only those associations for which |
|
553 |
aBlock evaluates to true. Return the new OrderedDictionary." |
|
554 |
||
555 |
|newDict| |
|
556 |
||
15801 | 557 |
newDict := self species new. |
15133 | 558 |
order do:[:key | |
559 |
|assoc| |
|
560 |
||
561 |
assoc := self associationAt:key. |
|
562 |
(aBlock value:assoc) ifTrue: [ |
|
15801 | 563 |
newDict at:key put:assoc value. |
15133 | 564 |
] |
565 |
]. |
|
566 |
^ newDict |
|
567 |
! |
|
568 |
||
569 |
collect: aBlock |
|
570 |
"Evaluate aBlock with each of the values of the dictionary as argument, |
|
571 |
and return a new (ordered) collection with the results" |
|
572 |
||
573 |
^ order collect:[:key | (aBlock value: (self at:key))]. |
|
574 |
! |
|
575 |
||
16216 | 576 |
detect: aBlock ifNone:anExceptionValue |
15759 | 577 |
"evaluate the argument, aBlock for each element in the receiver until |
578 |
the block returns true; in this case return the element which caused |
|
579 |
the true evaluation. |
|
16216 | 580 |
If none of the evaluations returns true, return the value of anExceptionValue" |
15759 | 581 |
|
582 |
order do:[:key | |
|
583 |
|el| |
|
15801 | 584 |
el := self at:key. |
585 |
(aBlock value:el) ifTrue:[^ el] |
|
15759 | 586 |
]. |
16216 | 587 |
^ anExceptionValue value |
15759 | 588 |
! |
589 |
||
15133 | 590 |
do: aBlock |
16765 | 591 |
"Evaluate aBlock for each of the dictionary's values. |
592 |
Enumerate them in the order by which they were added." |
|
15133 | 593 |
|
594 |
order do: [:key | aBlock value: (self at: key)] |
|
595 |
! |
|
596 |
||
15801 | 597 |
do: aBlock from: firstIndex to: lastIndex |
598 |
<resource: #obsolete> |
|
599 |
||
600 |
self obsoleteMethodWarning:'use #from:to:do:'. |
|
15133 | 601 |
|
602 |
self from:firstIndex to:lastIndex do:aBlock. |
|
603 |
! |
|
604 |
||
605 |
findFirst:aBlock ifNone:exceptionalValue |
|
606 |
"Return the index of the first association in the dictionary for which aBlock |
|
607 |
evaluates as true. If the block does not evaluate to true, return exceptionalValue" |
|
608 |
||
15801 | 609 |
|stop "{ Class: SmallInteger }" | |
610 |
||
611 |
stop := order size. |
|
612 |
1 to:stop do:[:index | |
|
15133 | 613 |
(aBlock value:(self associationAt:(order at:index))) ifTrue: [^ index] |
614 |
]. |
|
615 |
^ exceptionalValue value |
|
616 |
! |
|
617 |
||
618 |
findLast:aBlock |
|
619 |
"Return the index of the last association in the dictionary for which aBlock |
|
620 |
evaluates as true. If the block does not evaluate to true, return 0" |
|
621 |
||
15801 | 622 |
|start "{ Class: SmallInteger }"| |
623 |
||
624 |
start := order size. |
|
625 |
start to:1 by:-1 do: [:index | |
|
15133 | 626 |
(aBlock value:(self associationAt:(order at:index))) ifTrue: [^ index] |
627 |
]. |
|
628 |
^ 0 |
|
629 |
! |
|
630 |
||
631 |
findLast:aBlock startingAt:startIndex |
|
632 |
"Return the index of the last association in the dictionary for which aBlock |
|
15662 | 633 |
evaluates as true. Start the backward search at startIndex. |
15133 | 634 |
If the block does not evaluate to true, return 0" |
635 |
||
15801 | 636 |
|start "{ Class: SmallInteger }"| |
637 |
||
638 |
start := startIndex. |
|
639 |
start to:1 by:-1 do: [:index | |
|
15133 | 640 |
(aBlock value:(self associationAt:(order at:index))) ifTrue: [^ index] |
641 |
]. |
|
642 |
^ 0 |
|
643 |
! |
|
644 |
||
645 |
findLast:aBlock startingAt:startIndex endingAt:endIndex |
|
646 |
"Return the index of the last association in the dictionary for which aBlock |
|
647 |
evaluates as true. Start the search at startIndex. |
|
648 |
End the search at endIndex or when an element is found. |
|
649 |
If the block does not evaluate to true, return 0" |
|
650 |
||
15801 | 651 |
|start "{ Class: SmallInteger }" |
652 |
end "{ Class: SmallInteger }"| |
|
653 |
||
654 |
start := startIndex. |
|
655 |
end := endIndex. |
|
656 |
start to:end by:-1 do: [:index | |
|
15133 | 657 |
(aBlock value:(self associationAt:(order at:index))) ifTrue: [^ index] |
658 |
]. |
|
659 |
^ 0 |
|
660 |
! |
|
661 |
||
662 |
from:firstIndex to:lastIndex do: aBlock |
|
663 |
"Evaluate aBlock with each of the dictionary's associations from index |
|
664 |
firstIndex to index secondIndex as the argument." |
|
665 |
||
15801 | 666 |
|start "{ Class:SmallInteger }" |
667 |
stop "{ Class:SmallInteger }" | |
|
668 |
||
669 |
start := firstIndex. "/ these assignments force type checking... |
|
670 |
stop := lastIndex. "/ and guarantee inline loop code below. |
|
671 |
order from:start to:stop do:[:key | |
|
15133 | 672 |
aBlock value: (self at:key) |
673 |
]. |
|
674 |
! |
|
675 |
||
15759 | 676 |
keysAndValuesDetect: aBlock ifNone:exceptionBlock |
677 |
"evaluate the argument, aBlock for each element in the receiver until |
|
678 |
the block returns true; in this case return the element which caused |
|
679 |
the true evaluation. |
|
680 |
If none of the evaluations returns true, return the result of the |
|
681 |
evaluation of the exceptionBlock" |
|
682 |
||
683 |
order do:[:key | |
|
684 |
|el| |
|
15801 | 685 |
el := self at:key. |
686 |
(aBlock value:key value:el) ifTrue:[^ el] |
|
15759 | 687 |
]. |
688 |
^ exceptionBlock value |
|
689 |
! |
|
690 |
||
15133 | 691 |
keysAndValuesDo:aBlock |
15451 | 692 |
"perform the block for all keys and values in the collection. |
693 |
Enumerate them in the order by which they were added. |
|
15133 | 694 |
|
695 |
See also: |
|
696 |
#associationsDo: (which passes key-value associations) |
|
16765 | 697 |
#keysDo: (which passes keys only) |
15133 | 698 |
#do: (which passes values only) |
699 |
||
700 |
WARNING: do not add/remove elements while iterating over the receiver. |
|
701 |
Iterate over a copy to do this." |
|
702 |
||
15801 | 703 |
order do:[:key | aBlock value:key value:(self at: key)]. |
15133 | 704 |
|
705 |
"Modified: / 26.6.1999 / 10:55:30 / ps" |
|
706 |
"Created: / 15.10.1999 / 16:49:31 / cg" |
|
707 |
"Modified: / 15.10.1999 / 16:53:50 / cg" |
|
708 |
! |
|
709 |
||
15451 | 710 |
keysAndValuesReverseDo:aBlock |
711 |
"perform the block for all keys and values in the collection. |
|
712 |
Enumerate them in the reverse order from which they were added. |
|
713 |
||
714 |
See also: |
|
715 |
#associationsDo: (which passes key-value associations) |
|
716 |
#keysAndValuesDo: (which passes keys & values separately) |
|
717 |
#do: (which passes values only) |
|
718 |
||
719 |
WARNING: do not add/remove elements while iterating over the receiver. |
|
720 |
Iterate over a copy to do this." |
|
721 |
||
722 |
order reverseDo: [:key | aBlock value:key value:(self at: key)]. |
|
723 |
||
724 |
"Modified: / 26.6.1999 / 10:55:30 / ps" |
|
725 |
"Created: / 15.10.1999 / 16:49:31 / cg" |
|
726 |
"Modified: / 15.10.1999 / 16:53:50 / cg" |
|
727 |
! |
|
728 |
||
15133 | 729 |
keysDo:aBlock |
730 |
"evaluate the argument, aBlock for every key in the collection. |
|
16765 | 731 |
Enumerate them in the order by which they were added. |
15133 | 732 |
|
733 |
See also: |
|
734 |
#associationsDo: (which passes key-value associations) |
|
735 |
#keysAndValuesDo: (which passes keys & values separately) |
|
736 |
#do: (which passes values only) |
|
737 |
||
738 |
WARNING: do not add/remove elements while iterating over the receiver. |
|
739 |
Iterate over a copy to do this." |
|
740 |
||
741 |
order do:[:key | aBlock value:key]. |
|
742 |
||
743 |
"Created: / 26-06-1999 / 10:53:00 / ps" |
|
744 |
"Modified: / 24-08-2010 / 10:14:06 / cg" |
|
745 |
! |
|
746 |
||
747 |
reverseDo: aBlock |
|
748 |
"Evaluate aBlock with each of the dictionary's associations as the argument, |
|
16765 | 749 |
starting with the last added element and taking each in sequence up to the first." |
15133 | 750 |
|
15801 | 751 |
|sz "{ Class:SmallInteger }"| |
752 |
||
753 |
sz := order size. |
|
754 |
sz to:1 by:-1 do: [:index | |
|
15133 | 755 |
aBlock value:(self associationAt:(order at:index)) |
756 |
] |
|
757 |
! |
|
758 |
||
759 |
reversed |
|
760 |
"Return with a new OrderedDictionary with its associations in reverse order." |
|
761 |
||
15801 | 762 |
^ self copy reverse. |
15133 | 763 |
! |
764 |
||
765 |
select:aBlock |
|
766 |
"Evaluate aBlock with each of the dictionary's values as the argument. |
|
767 |
Collect into a new OrderedDictionary only those associations for which |
|
768 |
aBlock evaluated to true. Return the new OrderedDictionary." |
|
769 |
||
770 |
|newColl| |
|
771 |
||
772 |
newColl := self species new. |
|
773 |
order do:[:key | |
|
15801 | 774 |
|val| |
15133 | 775 |
|
15801 | 776 |
val := self at:key. |
777 |
(aBlock value:val) ifTrue:[ |
|
778 |
newColl at:key put:val. |
|
15133 | 779 |
] |
780 |
]. |
|
781 |
^ newColl |
|
782 |
! ! |
|
783 |
||
784 |
!OrderedDictionary methodsFor:'initialization'! |
|
785 |
||
786 |
initializeOrder |
|
787 |
order := OrderedCollection new |
|
788 |
! ! |
|
789 |
||
790 |
!OrderedDictionary methodsFor:'private'! |
|
791 |
||
15801 | 792 |
removeFromOrder: aKey |
793 |
<resource: #obsolete> |
|
794 |
||
795 |
order remove: aKey ifAbsent: [] |
|
15133 | 796 |
! ! |
797 |
||
798 |
!OrderedDictionary methodsFor:'queries'! |
|
799 |
||
800 |
occurrencesOfKey: aKey |
|
801 |
"Return how many of the dictionary's keys are equal to aKey." |
|
802 |
||
803 |
^ order count:[:eachKey | aKey = eachKey] |
|
804 |
||
805 |
"/ cg: the original code was not very smalltalkish: |
|
806 |
"/ |
|
807 |
"/ | count | |
|
808 |
"/ |
|
809 |
"/ count := 0. |
|
810 |
"/ 1 to: self size do: [:index | aKey = (order at: index) ifTrue: [count := count + 1]]. |
|
811 |
"/ ^count |
|
812 |
! |
|
813 |
||
814 |
occurrencesOfValue: aValue |
|
815 |
"Return how many of the dictionary's values are equal to aValue." |
|
816 |
||
817 |
^ order count:[:eachKey | aValue = (self at:eachKey)] |
|
818 |
||
819 |
"/ cg: the original code was not very smalltalkish: |
|
820 |
"/ |
|
821 |
"/ | count | |
|
822 |
"/ |
|
823 |
"/ count := 0. |
|
824 |
"/ 1 to: self size do: [:index | |
|
825 |
"/ aValue = (self at: (order at: index)) ifTrue: [count := count + 1]]. |
|
826 |
"/ ^count |
|
827 |
! ! |
|
828 |
||
829 |
!OrderedDictionary methodsFor:'removing'! |
|
830 |
||
831 |
removeFirst |
|
832 |
|key| |
|
833 |
||
834 |
order size == 0 ifTrue:[ |
|
15801 | 835 |
"error if collection is empty" |
836 |
^ self emptyCollectionError. |
|
15133 | 837 |
]. |
838 |
key := order removeFirst. |
|
839 |
^ super removeKey:key. |
|
840 |
! |
|
841 |
||
842 |
removeFromIndex:fromIndex toIndex:toIndex |
|
843 |
"Returns the receiver." |
|
844 |
||
15801 | 845 |
|start "{ Class:SmallInteger }" |
846 |
stop "{ Class:SmallInteger }" | |
|
15133 | 847 |
|
15801 | 848 |
start := fromIndex. |
849 |
stop := toIndex. |
|
850 |
||
851 |
order from:start to:stop do:[:key | |
|
15133 | 852 |
super removeKey:key. |
853 |
]. |
|
15801 | 854 |
order removeFromIndex:fromIndex toIndex:toIndex. |
15133 | 855 |
|
856 |
"Created: 28.9.1995 / 12:04:33 / stefan" |
|
857 |
! |
|
858 |
||
15801 | 859 |
removeIndex:anInteger |
860 |
self removeFromIndex:anInteger toIndex:anInteger. |
|
861 |
! |
|
862 |
||
15133 | 863 |
removeKey:aKey |
864 |
order remove:aKey. |
|
865 |
^ super removeKey:aKey. |
|
866 |
! |
|
867 |
||
868 |
removeKey:aKey ifAbsent:aBlock |
|
15801 | 869 |
|oldValue| |
870 |
||
871 |
oldValue := super removeKey:aKey ifAbsent:aBlock. |
|
15133 | 872 |
order remove:aKey ifAbsent:[]. |
15801 | 873 |
^ oldValue. |
15133 | 874 |
|
875 |
"Created: / 31-01-2011 / 22:04:01 / cg" |
|
876 |
! |
|
877 |
||
878 |
removeLast |
|
879 |
|key| |
|
880 |
||
881 |
order size == 0 ifTrue:[ |
|
882 |
"error if collection is empty" |
|
883 |
||
884 |
^ self emptyCollectionError. |
|
885 |
]. |
|
886 |
key := order removeLast. |
|
887 |
^ super removeKey:key. |
|
888 |
! ! |
|
889 |
||
890 |
!OrderedDictionary methodsFor:'searching'! |
|
891 |
||
892 |
identityIndexOfAssociation: anAssociation |
|
893 |
"Return the identity index of anAssociation within the receiver. If the receiver |
|
894 |
does not contain anAssociation, return 0." |
|
895 |
||
896 |
^ self identityIndexOfAssociation: anAssociation ifAbsent: [0] |
|
897 |
! |
|
898 |
||
899 |
identityIndexOfAssociation: anAssociation ifAbsent: exceptionBlock |
|
900 |
"Return the identity index of anAssociation within the receiver. |
|
901 |
If the receiver does not contain anAssociation, |
|
902 |
return the result of evaluating the exceptionBlock." |
|
903 |
||
904 |
"/ as ST/X's dictionaries do not store the associations |
|
905 |
"/ (instead, they store the keys and values in separate collections) |
|
906 |
"/ this will not work. You have to think about it and rewrite your code. |
|
907 |
self error:'this does not work in Smalltalk/X'. |
|
908 |
||
909 |
order keysAndValuesDo:[:i :key | |
|
910 |
(self associationAt:key) == anAssociation ifTrue: [^i] |
|
911 |
]. |
|
912 |
^exceptionBlock value |
|
913 |
! |
|
914 |
||
915 |
identityIndexOfKey: aKey |
|
916 |
"Return the identity index of aKey within the receiver. If the receiver |
|
917 |
does not contain aKey, return 0." |
|
918 |
||
919 |
^self identityIndexOfKey: aKey ifAbsent: [0] |
|
920 |
! |
|
921 |
||
922 |
identityIndexOfKey: aKey ifAbsent: exceptionBlock |
|
923 |
"Return the identity index of aKey within the receiver. If the receiver does |
|
924 |
not contain aKey, return the result of evaluating the exceptionBlock." |
|
925 |
||
926 |
^ order identityIndexOf:aKey ifAbsent:exceptionBlock |
|
927 |
! |
|
928 |
||
929 |
identityIndexOfValue: aValue |
|
930 |
"Return the identity index of aValue within the receiver. If the receiver |
|
931 |
does not contain aValue, return 0." |
|
932 |
||
933 |
^self identityIndexOfValue: aValue ifAbsent: [0] |
|
934 |
! |
|
935 |
||
936 |
identityIndexOfValue: aValue ifAbsent: exceptionBlock |
|
937 |
"Return the identity index of aValue within the receiver. If the receiver |
|
938 |
does not contain aValue, return the result of evaluating the exceptionBlock." |
|
939 |
||
940 |
order keysAndValuesDo:[:i :key | (self at:key) == aValue ifTrue: [^i]]. |
|
941 |
^exceptionBlock value |
|
942 |
! |
|
943 |
||
944 |
indexOfAssociation: anAssociation |
|
945 |
"Return the index of anAssociation within the receiver. If the receiver does |
|
946 |
not contain anAssociation, return 0." |
|
947 |
||
948 |
^self indexOfAssociation: anAssociation ifAbsent: [0] |
|
949 |
! |
|
950 |
||
951 |
indexOfAssociation: anAssociation ifAbsent: exceptionBlock |
|
952 |
"Return the identity index of anAssociation within the receiver. If the receiver |
|
953 |
does not contain anAssociation, return the result of evaluating the exceptionBlock." |
|
954 |
||
955 |
order keysAndValuesDo:[:i :key | |
|
956 |
(self associationAt:key) = anAssociation ifTrue: [^i] |
|
957 |
]. |
|
958 |
^exceptionBlock value |
|
959 |
! |
|
960 |
||
961 |
indexOfKey: aKey |
|
962 |
"Return the index of aKey within the receiver. If the receiver does |
|
963 |
not contain aKey, return 0." |
|
964 |
||
965 |
^self indexOfKey: aKey ifAbsent: [0] |
|
966 |
! |
|
967 |
||
968 |
indexOfKey: aKey ifAbsent: exceptionBlock |
|
969 |
"Return the identity index of aKey within the receiver. If the receiver does |
|
970 |
not contain aKey, return the result of evaluating the exceptionBlock." |
|
971 |
||
972 |
^ order indexOf:aKey ifAbsent:exceptionBlock |
|
973 |
! |
|
974 |
||
975 |
indexOfValue: aValue |
|
976 |
"Return the index of aValue within the receiver. |
|
977 |
If the receiver does not contain aValue, return 0." |
|
978 |
||
979 |
^self indexOfValue: aValue ifAbsent: [0] |
|
980 |
! |
|
981 |
||
982 |
indexOfValue: aValue ifAbsent: exceptionBlock |
|
983 |
"Return the identity index of aValue within the receiver. |
|
984 |
If the receiver does not contain aValue, return the result of evaluating the exceptionBlock." |
|
985 |
||
986 |
order keysAndValuesDo:[:i :key | (self at:key) = aValue ifTrue: [^i]]. |
|
987 |
^ exceptionBlock value |
|
988 |
! |
|
989 |
||
990 |
nextIndexOfAssociation: aAssociation from: startIndex to: stopIndex |
|
991 |
"Return the next index of aAssociation within the receiver between startIndex |
|
992 |
and stopIndex. If the receiver does not contain aAssociation, return nil" |
|
993 |
||
15801 | 994 |
|start "{ Class:SmallInteger }" |
995 |
stop "{ Class:SmallInteger }"| |
|
996 |
||
997 |
start := startIndex. |
|
998 |
stop := stopIndex. |
|
999 |
start to: stop do: [:i | |
|
15133 | 1000 |
(self associationAt: (order at: i)) = aAssociation ifTrue: [^i]]. |
1001 |
^nil |
|
1002 |
! |
|
1003 |
||
1004 |
nextIndexOfKey: aKey from: startIndex to: stopIndex |
|
1005 |
"Return the next index of aKey within the receiver between startIndex and |
|
1006 |
stopIndex. If the receiver does not contain aKey, return nil" |
|
1007 |
||
15801 | 1008 |
|start "{ Class:SmallInteger }" |
1009 |
stop "{ Class:SmallInteger }"| |
|
1010 |
||
1011 |
start := startIndex. |
|
1012 |
stop := stopIndex. |
|
1013 |
start to: stop do: [:i | |
|
15133 | 1014 |
(order at: i) = aKey ifTrue: [^i]]. |
1015 |
^nil |
|
1016 |
! |
|
1017 |
||
1018 |
nextIndexOfValue: aValue from: startIndex to: stopIndex |
|
1019 |
"Return the next index of aValue within the receiver between startIndex and |
|
1020 |
stopIndex. If the receiver does not contain aValue, return nil" |
|
1021 |
||
15801 | 1022 |
|start "{ Class:SmallInteger }" |
1023 |
stop "{ Class:SmallInteger }" | |
|
1024 |
||
1025 |
start := startIndex. |
|
1026 |
stop := stopIndex. |
|
1027 |
start to: stop do: [:i | |
|
15133 | 1028 |
(self at: (order at: i)) = aValue ifTrue: [^i]]. |
1029 |
^nil |
|
1030 |
! |
|
1031 |
||
1032 |
prevIndexOfAssociation: aAssociation from: startIndex to: stopIndex |
|
1033 |
"Return the previous index of aAssociation within the receiver between |
|
1034 |
startIndex and stopIndex working backwards through the receiver. |
|
1035 |
If the receiver does not contain aAssociation, return nil" |
|
1036 |
||
15801 | 1037 |
|start "{ Class:SmallInteger }" |
1038 |
stop "{ Class:SmallInteger }"| |
|
1039 |
||
1040 |
start := startIndex. |
|
1041 |
stop := stopIndex. |
|
1042 |
start to: stop by: -1 |
|
15133 | 1043 |
do: [:i | (self associationAt: (order at: i)) = aAssociation ifTrue: [^i]]. |
1044 |
^nil |
|
1045 |
! |
|
1046 |
||
1047 |
prevIndexOfKey: aKey from: startIndex to: stopIndex |
|
1048 |
"Return the previous index of aKey within the receiver between startIndex and |
|
1049 |
stopIndex working backwards through the receiver. |
|
1050 |
If the receiver does not contain aKey, return nil" |
|
1051 |
||
15801 | 1052 |
|start "{ Class:SmallInteger }" |
1053 |
stop "{ Class:SmallInteger }"| |
|
1054 |
||
1055 |
start := startIndex. |
|
1056 |
stop := stopIndex. |
|
1057 |
start to: stop by: -1 |
|
15133 | 1058 |
do: [:i | (order at: i) = aKey ifTrue: [^i]]. |
1059 |
^nil |
|
1060 |
! |
|
1061 |
||
15801 | 1062 |
prevIndexOfValue:aValue from:startIndex to:stopIndex |
15133 | 1063 |
"Return the previous index of aValue within the receiver between startIndex |
15801 | 1064 |
and stopIndex working backwards through the receiver. |
15133 | 1065 |
If the receiver does not contain aValue, return nil" |
15801 | 1066 |
|
1067 |
|start "{ Class:SmallInteger }" |
|
1068 |
stop "{ Class:SmallInteger }"| |
|
15133 | 1069 |
|
15801 | 1070 |
start := startIndex. |
1071 |
stop := stopIndex. |
|
1072 |
start to:stop by:-1 do:[:i | |
|
1073 |
(self at:(order at:i)) = aValue ifTrue:[ |
|
1074 |
^ i |
|
1075 |
] |
|
1076 |
]. |
|
1077 |
^ nil |
|
15133 | 1078 |
! ! |
1079 |
||
1080 |
!OrderedDictionary methodsFor:'sorting & reordering'! |
|
1081 |
||
1082 |
reverse |
|
1083 |
"Destructively reverse my order. |
|
1084 |
WARNING: this is a destructive operation, which modifies the receiver. |
|
1085 |
Please use reversed (with a d) for a functional version." |
|
1086 |
||
1087 |
order reverse |
|
1088 |
! |
|
1089 |
||
1090 |
sort |
|
1091 |
"Destructively sort my order. |
|
1092 |
WARNING: this is a destructive operation, which modifies the receiver" |
|
1093 |
||
1094 |
order sort |
|
1095 |
! |
|
1096 |
||
1097 |
sort:aSortBlock |
|
1098 |
"Destructively sort my order. |
|
1099 |
WARNING: this is a destructive operation, which modifies the receiver" |
|
1100 |
||
1101 |
order sort:aSortBlock |
|
1102 |
! ! |
|
1103 |
||
1104 |
!OrderedDictionary class methodsFor:'documentation'! |
|
1105 |
||
1106 |
version |
|
16765 | 1107 |
^ '$Header: /cvs/stx/stx/libbasic/OrderedDictionary.st,v 1.47 2014-07-11 09:14:55 cg Exp $' |
15133 | 1108 |
! |
1109 |
||
1110 |
version_CVS |
|
16765 | 1111 |
^ '$Header: /cvs/stx/stx/libbasic/OrderedDictionary.st,v 1.47 2014-07-11 09:14:55 cg Exp $' |
15133 | 1112 |
! ! |
1113 |