author | Jan Vrany <jan.vrany@labware.com> |
Wed, 30 Jun 2021 14:07:56 +0100 | |
branch | jv |
changeset 5481 | 19d6355dc3e1 |
parent 4281 | c0457c1b6e53 |
child 5209 | 6ea076e6515d |
permissions | -rw-r--r-- |
4281 | 1 |
" |
2 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
"{ Package: 'stx:libbasic2' }" |
|
13 |
||
14 |
"{ NameSpace: Smalltalk }" |
|
15 |
||
182 | 16 |
Object subclass:#SequenceableCollectionSorter |
17 |
instanceVariableNames:'collection atSelector putSelector sizeSelector sortBlock' |
|
18 |
classVariableNames:'DefaultSortBlock' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Collections-Support' |
|
21 |
! |
|
22 |
||
23 |
!SequenceableCollectionSorter class methodsFor:'documentation'! |
|
24 |
||
4281 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
182 | 39 |
documentation |
40 |
" |
|
41 |
a SequenceableCollectionSorter allows for anything which responds to |
|
42 |
keyed at/atPut messages to be sorted just like a SequenceableCollection. |
|
183
01781ca31dad
really use #<= for comparing (used #<)
Claus Gittinger <cg@exept.de>
parents:
182
diff
changeset
|
43 |
Since the access messages can be customized, even non collections |
01781ca31dad
really use #<= for comparing (used #<)
Claus Gittinger <cg@exept.de>
parents:
182
diff
changeset
|
44 |
(or collection simulators, models etc.) can be sorted with these sorters. |
182 | 45 |
(use #atSelector: / #putSelector: and #sizeSelector: for customization). |
46 |
||
47 |
As with collection sorting, the sortBlock can be specified and defaults to |
|
48 |
a block which compares using #< messages. |
|
49 |
" |
|
50 |
! |
|
51 |
||
52 |
examples |
|
53 |
" |
|
54 |
|a sorter| |
|
55 |
||
56 |
a := #(10 5 2 17 5 99 -5). |
|
57 |
sorter := SequenceableCollectionSorter on:a. |
|
58 |
sorter sort. |
|
350 | 59 |
Transcript showCR:a printString |
182 | 60 |
" |
61 |
! ! |
|
62 |
||
63 |
!SequenceableCollectionSorter class methodsFor:'initialization'! |
|
64 |
||
65 |
initialize |
|
66 |
DefaultSortBlock := [:a :b | a <= b] |
|
67 |
||
68 |
" |
|
69 |
SequenceableCollectionSorter initialize |
|
70 |
" |
|
71 |
||
72 |
"Modified: 6.2.1996 / 15:47:48 / cg" |
|
73 |
! ! |
|
74 |
||
75 |
!SequenceableCollectionSorter class methodsFor:'instance creation'! |
|
76 |
||
77 |
on:aCollection |
|
78 |
^ self new collection:aCollection; sortBlock:DefaultSortBlock |
|
79 |
||
80 |
"Created: 6.2.1996 / 15:39:09 / cg" |
|
81 |
"Modified: 6.2.1996 / 16:07:36 / cg" |
|
82 |
! |
|
83 |
||
84 |
on:aCollection using:aTwoArgBlock |
|
85 |
^ self new collection:aCollection; sortBlock:aTwoArgBlock |
|
86 |
||
87 |
"Created: 6.2.1996 / 15:39:32 / cg" |
|
88 |
! |
|
89 |
||
90 |
sort:aCollection |
|
91 |
(self new collection:aCollection; sortBlock:DefaultSortBlock) sort |
|
92 |
||
93 |
"Created: 6.2.1996 / 15:40:04 / cg" |
|
94 |
"Modified: 6.2.1996 / 16:07:42 / cg" |
|
95 |
! |
|
96 |
||
97 |
sort:aCollection using:aTwoArgBlock |
|
98 |
(self new collection:aCollection; sortBlock:aTwoArgBlock) sort |
|
99 |
||
100 |
"Created: 6.2.1996 / 15:39:58 / cg" |
|
101 |
! ! |
|
102 |
||
103 |
!SequenceableCollectionSorter methodsFor:'accessing'! |
|
104 |
||
105 |
atSelector:aSymbol |
|
106 |
"set the selector to access elements. |
|
107 |
If nil (the default), elements are accessed via #at:" |
|
108 |
||
109 |
atSelector := aSymbol |
|
110 |
||
111 |
"Created: 6.2.1996 / 15:35:49 / cg" |
|
112 |
! |
|
113 |
||
114 |
collection |
|
115 |
"return the collections being sorted." |
|
116 |
||
117 |
^ collection |
|
118 |
||
119 |
"Created: 6.2.1996 / 15:37:02 / cg" |
|
120 |
! |
|
121 |
||
122 |
collection:aCollection |
|
123 |
"set the collections being sorted." |
|
124 |
||
125 |
collection := aCollection |
|
126 |
||
127 |
"Created: 6.2.1996 / 15:37:20 / cg" |
|
128 |
! |
|
129 |
||
130 |
putSelector:aSymbol |
|
131 |
"set the selector to access elements. |
|
132 |
If nil (the default), elements are accessed via #at:put:" |
|
133 |
||
134 |
putSelector := aSymbol |
|
135 |
||
136 |
"Created: 6.2.1996 / 15:36:14 / cg" |
|
137 |
! |
|
138 |
||
139 |
sizeSelector:aSymbol |
|
140 |
"set the selector to get the collections size. |
|
141 |
If nil (the default), elements are accessed via #size" |
|
142 |
||
143 |
sizeSelector := aSymbol |
|
144 |
||
145 |
"Created: 6.2.1996 / 15:36:33 / cg" |
|
146 |
! |
|
147 |
||
148 |
sortBlock |
|
149 |
"return the sortBlock which is used to compare two elements. |
|
150 |
The default sortBlock compares elements by sending the #< message." |
|
151 |
||
152 |
^ sortBlock |
|
153 |
||
154 |
"Created: 6.2.1996 / 15:38:32 / cg" |
|
155 |
! |
|
156 |
||
157 |
sortBlock:aTwoArgBlock |
|
158 |
"set the sortBlock which is used to compare two elements. |
|
159 |
The default sortBlock compares elements by sending the #< message." |
|
160 |
||
161 |
sortBlock := aTwoArgBlock |
|
162 |
||
163 |
"Created: 6.2.1996 / 15:38:20 / cg" |
|
164 |
! ! |
|
165 |
||
166 |
!SequenceableCollectionSorter methodsFor:'sorting'! |
|
167 |
||
168 |
defaultSort:inBegin to:inEnd |
|
169 |
"actual sort worker for sorting when the sortBlock is nil (or the default) |
|
184 | 170 |
and default atSelector/putSelectors are to be used. |
171 |
This will execute slightly faster, since no #perform-indirection is needed." |
|
182 | 172 |
|
173 |
|begin "{ Class: SmallInteger }" |
|
174 |
end "{ Class: SmallInteger }" |
|
175 |
b "{ Class: SmallInteger }" |
|
176 |
e "{ Class: SmallInteger }" |
|
177 |
middleElement temp1 temp2 | |
|
178 |
||
179 |
begin := inBegin. "/ this also does a type-check |
|
180 |
end := inEnd. |
|
181 |
||
182 |
b := begin. |
|
183 |
e := end. |
|
184 |
middleElement := collection at:((b + e) // 2). |
|
185 |
||
186 |
[b < e] whileTrue:[ |
|
183
01781ca31dad
really use #<= for comparing (used #<)
Claus Gittinger <cg@exept.de>
parents:
182
diff
changeset
|
187 |
[b < end and:[(collection at:b) <= middleElement]] whileTrue:[b := b + 1]. |
01781ca31dad
really use #<= for comparing (used #<)
Claus Gittinger <cg@exept.de>
parents:
182
diff
changeset
|
188 |
[e > begin and:[middleElement <= (collection at:e)]] whileTrue:[e := e - 1]. |
182 | 189 |
|
190 |
(b <= e) ifTrue:[ |
|
191 |
(b == e) ifFalse:[ |
|
192 |
temp1 := collection at:b. temp2 := collection at:e. |
|
193 |
collection at:b put:temp2. collection at:e put:temp1 |
|
194 |
]. |
|
195 |
b := b + 1. |
|
196 |
e := e - 1 |
|
197 |
] |
|
198 |
]. |
|
199 |
(begin < e) ifTrue:[self defaultSort:begin to:e]. |
|
200 |
(b < end) ifTrue:[self defaultSort:b to:end] |
|
201 |
||
202 |
"Created: 6.2.1996 / 15:44:37 / cg" |
|
184 | 203 |
"Modified: 6.2.1996 / 18:06:23 / cg" |
182 | 204 |
! |
205 |
||
585
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
206 |
nonDefaultSort3:inBegin to:inEnd with:p |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
207 |
"actual sort worker for sorting when a non default sortBlock |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
208 |
with 3 args (stringSort) is used." |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
209 |
|
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
210 |
|begin "{ Class: SmallInteger }" |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
211 |
end "{ Class: SmallInteger }" |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
212 |
b "{ Class: SmallInteger }" |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
213 |
e "{ Class: SmallInteger }" |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
214 |
middleElement temp1 temp2 |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
215 |
atSel putSel| |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
216 |
|
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
217 |
atSel := atSelector ? #at:. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
218 |
putSel := putSelector ? #at:put:. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
219 |
|
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
220 |
begin := inBegin. "/ this also does a type-check |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
221 |
end := inEnd. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
222 |
|
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
223 |
b := begin. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
224 |
e := end. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
225 |
middleElement := collection perform:atSel with:((b + e) // 2). |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
226 |
|
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
227 |
[b < e] whileTrue:[ |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
228 |
[b < end |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
229 |
and:[sortBlock |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
230 |
value:p |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
231 |
value:(collection perform:atSel with:b) |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
232 |
value:middleElement]] |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
233 |
whileTrue:[b := b + 1]. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
234 |
[e > begin |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
235 |
and:[sortBlock |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
236 |
value:p |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
237 |
value:middleElement |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
238 |
value:(collection perform:atSel with:e)]] |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
239 |
whileTrue:[e := e - 1]. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
240 |
|
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
241 |
(b <= e) ifTrue:[ |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
242 |
(b == e) ifFalse:[ |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
243 |
temp1 := (collection perform:atSel with:b). |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
244 |
temp2 := (collection perform:atSel with:e). |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
245 |
collection perform:putSel with:b with:temp2. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
246 |
collection perform:putSel with:e with:temp1. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
247 |
]. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
248 |
b := b + 1. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
249 |
e := e - 1 |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
250 |
] |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
251 |
]. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
252 |
(begin < e) ifTrue:[self nonDefaultSort3:begin to:e with:p]. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
253 |
(b < end) ifTrue:[self nonDefaultSort3:b to:end with:p] |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
254 |
|
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
255 |
"Modified: / 27.10.1997 / 04:52:41 / cg" |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
256 |
"Created: / 27.10.1997 / 18:54:54 / cg" |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
257 |
! |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
258 |
|
182 | 259 |
nonDefaultSort:inBegin to:inEnd |
260 |
"actual sort worker for sorting when a non default sortBlock |
|
184 | 261 |
or nonNil access selectors are used." |
182 | 262 |
|
263 |
|begin "{ Class: SmallInteger }" |
|
264 |
end "{ Class: SmallInteger }" |
|
265 |
b "{ Class: SmallInteger }" |
|
266 |
e "{ Class: SmallInteger }" |
|
585
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
267 |
middleElement temp1 temp2 |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
268 |
atSel putSel| |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
269 |
|
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
270 |
atSel := atSelector ? #at:. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
271 |
putSel := putSelector ? #at:put:. |
182 | 272 |
|
273 |
begin := inBegin. "/ this also does a type-check |
|
274 |
end := inEnd. |
|
275 |
||
276 |
b := begin. |
|
277 |
e := end. |
|
585
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
278 |
middleElement := collection perform:atSel with:((b + e) // 2). |
182 | 279 |
|
280 |
[b < e] whileTrue:[ |
|
281 |
[b < end |
|
282 |
and:[sortBlock |
|
585
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
283 |
value:(collection perform:atSel with:b) |
182 | 284 |
value:middleElement]] |
285 |
whileTrue:[b := b + 1]. |
|
286 |
[e > begin |
|
287 |
and:[sortBlock |
|
288 |
value:middleElement |
|
585
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
289 |
value:(collection perform:atSel with:e)]] |
182 | 290 |
whileTrue:[e := e - 1]. |
291 |
||
292 |
(b <= e) ifTrue:[ |
|
293 |
(b == e) ifFalse:[ |
|
585
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
294 |
temp1 := (collection perform:atSel with:b). |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
295 |
temp2 := (collection perform:atSel with:e). |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
296 |
collection perform:putSel with:b with:temp2. |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
297 |
collection perform:putSel with:e with:temp1. |
182 | 298 |
]. |
299 |
b := b + 1. |
|
300 |
e := e - 1 |
|
301 |
] |
|
302 |
]. |
|
303 |
(begin < e) ifTrue:[self nonDefaultSort:begin to:e]. |
|
304 |
(b < end) ifTrue:[self nonDefaultSort:b to:end] |
|
305 |
||
585
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
306 |
"Created: / 6.2.1996 / 16:06:46 / cg" |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
307 |
"Modified: / 27.10.1997 / 04:52:41 / cg" |
182 | 308 |
! |
309 |
||
310 |
sort |
|
311 |
|sz| |
|
312 |
||
313 |
sizeSelector isNil ifTrue:[ |
|
314 |
sz := collection size |
|
315 |
] ifFalse:[ |
|
316 |
sz := collection perform:sizeSelector |
|
317 |
]. |
|
318 |
self sort:1 to:sz |
|
319 |
||
320 |
"Created: 6.2.1996 / 15:41:21 / cg" |
|
321 |
! |
|
322 |
||
323 |
sort:from to:to |
|
324 |
"actual sort worker for sort-messages" |
|
325 |
||
326 |
(atSelector isNil |
|
327 |
and:[putSelector isNil |
|
328 |
and:[sortBlock isNil or:[sortBlock == DefaultSortBlock]]]) ifTrue:[ |
|
329 |
self defaultSort:from to:to |
|
330 |
] ifFalse:[ |
|
585
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
331 |
sortBlock numArgs == 3 ifTrue:[ |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
332 |
self nonDefaultSort3:from to:to with:nil "p" |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
333 |
] ifFalse:[ |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
334 |
self nonDefaultSort:from to:to |
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
335 |
] |
182 | 336 |
]. |
337 |
||
585
ab03e26e2df1
support 3-arg sorting using a collationPolicy
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
338 |
"Modified: / 27.10.1997 / 18:55:48 / cg" |
182 | 339 |
! ! |
340 |
||
341 |
!SequenceableCollectionSorter class methodsFor:'documentation'! |
|
342 |
||
343 |
version |
|
4281 | 344 |
^ '$Header$' |
182 | 345 |
! ! |
4281 | 346 |
|
347 |
||
182 | 348 |
SequenceableCollectionSorter initialize! |