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