equal
deleted
inserted
replaced
19 |
19 |
20 OrderedCollection comment:' |
20 OrderedCollection comment:' |
21 COPYRIGHT (c) 1989 by Claus Gittinger |
21 COPYRIGHT (c) 1989 by Claus Gittinger |
22 All Rights Reserved |
22 All Rights Reserved |
23 |
23 |
24 $Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.23 1995-05-01 21:38:19 claus Exp $ |
24 $Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.24 1995-05-16 17:08:13 claus Exp $ |
25 '! |
25 '! |
26 |
26 |
27 !OrderedCollection class methodsFor:'documentation'! |
27 !OrderedCollection class methodsFor:'documentation'! |
28 |
28 |
29 copyright |
29 copyright |
40 " |
40 " |
41 ! |
41 ! |
42 |
42 |
43 version |
43 version |
44 " |
44 " |
45 $Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.23 1995-05-01 21:38:19 claus Exp $ |
45 $Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.24 1995-05-16 17:08:13 claus Exp $ |
46 " |
46 " |
47 ! |
47 ! |
48 |
48 |
49 documentation |
49 documentation |
50 " |
50 " |
391 |
391 |
392 idx := self indexOf:oldObject. |
392 idx := self indexOf:oldObject. |
393 idx ~~ 0 ifTrue:[ |
393 idx ~~ 0 ifTrue:[ |
394 ^ self add:newObject beforeIndex:(idx + 1). |
394 ^ self add:newObject beforeIndex:(idx + 1). |
395 ]. |
395 ]. |
396 self errorNotFound |
396 self errorNotFound:oldObject |
397 |
397 |
398 " |
398 " |
399 |c| |
399 |c| |
400 c := #(4 3 2 1) asOrderedCollection. |
400 c := #(4 3 2 1) asOrderedCollection. |
401 c add:'here' after:3. |
401 c add:'here' after:3. |
422 |
422 |
423 idx := self indexOf:oldObject. |
423 idx := self indexOf:oldObject. |
424 idx ~~ 0 ifTrue:[ |
424 idx ~~ 0 ifTrue:[ |
425 ^ self add:newObject beforeIndex:idx. |
425 ^ self add:newObject beforeIndex:idx. |
426 ]. |
426 ]. |
427 self errorNotFound |
427 self errorNotFound:oldObject |
428 |
428 |
429 " |
429 " |
430 |c| |
430 |c| |
431 c := #(4 3 2 1) asOrderedCollection. |
431 c := #(4 3 2 1) asOrderedCollection. |
432 c add:'here' before:3. |
432 c add:'here' before:3. |
570 |
570 |
571 after:anObject |
571 after:anObject |
572 "return the element, after anObject. |
572 "return the element, after anObject. |
573 If anObject is not in the receiver, report an error." |
573 If anObject is not in the receiver, report an error." |
574 |
574 |
575 ^ self after:anObject ifAbsent:[self errorNotFound] |
575 ^ self after:anObject ifAbsent:[self errorNotFound:anObject] |
576 |
576 |
577 " |
577 " |
578 #(4 3 2 1) asOrderedCollection after:3. |
578 #(4 3 2 1) asOrderedCollection after:3. |
579 #(4 3 2 1) asOrderedCollection after:5 |
579 #(4 3 2 1) asOrderedCollection after:5 |
580 #(4 3 2 1) asOrderedCollection after:1 |
580 #(4 3 2 1) asOrderedCollection after:1 |
603 |
603 |
604 before:anObject |
604 before:anObject |
605 "return the element before the argument, anObject. |
605 "return the element before the argument, anObject. |
606 If anObject is not in the receiver, report an error." |
606 If anObject is not in the receiver, report an error." |
607 |
607 |
608 ^ self before:anObject ifAbsent:[self errorNotFound] |
608 ^ self before:anObject ifAbsent:[self errorNotFound:anObject] |
609 |
609 |
610 " |
610 " |
611 #(4 3 2 1) asOrderedCollection before:3. |
611 #(4 3 2 1) asOrderedCollection before:3. |
612 #(4 3 2 1) asOrderedCollection before:4 |
612 #(4 3 2 1) asOrderedCollection before:4 |
613 #(4 3 2 1) asOrderedCollection before:0 |
613 #(4 3 2 1) asOrderedCollection before:0 |