equal
deleted
inserted
replaced
448 Abstract subclasses must redefine this again." |
448 Abstract subclasses must redefine this again." |
449 |
449 |
450 ^ self == SequenceableCollection |
450 ^ self == SequenceableCollection |
451 ! ! |
451 ! ! |
452 |
452 |
453 |
|
454 |
|
455 !SequenceableCollection methodsFor:'Compatibility-Squeak'! |
453 !SequenceableCollection methodsFor:'Compatibility-Squeak'! |
456 |
454 |
457 allButFirst |
455 allButFirst |
458 "Return a copy of the receiver containing all but the first element. |
456 "Return a copy of the receiver containing all but the first element. |
459 Returns an empty collection if there are not at least two elements. |
457 Returns an empty collection if there are not at least two elements. |
785 !SequenceableCollection methodsFor:'Compatibility-VW'! |
783 !SequenceableCollection methodsFor:'Compatibility-VW'! |
786 |
784 |
787 replaceElementsFrom:start to:stop withArray:anArray startingAt:repStart |
785 replaceElementsFrom:start to:stop withArray:anArray startingAt:repStart |
788 ^ self replaceFrom:start to:stop with:anArray startingAt:repStart |
786 ^ self replaceFrom:start to:stop with:anArray startingAt:repStart |
789 ! ! |
787 ! ! |
790 |
|
791 |
788 |
792 !SequenceableCollection methodsFor:'accessing'! |
789 !SequenceableCollection methodsFor:'accessing'! |
793 |
790 |
794 after:anObject |
791 after:anObject |
795 "return the element, after anObject. |
792 "return the element, after anObject. |
4898 inGroupsOf:n collect:anNArgBlock |
4895 inGroupsOf:n collect:anNArgBlock |
4899 "evaluate the argument, anNArgBlock for every group of n elements in the collection, |
4896 "evaluate the argument, anNArgBlock for every group of n elements in the collection, |
4900 and collect the results. |
4897 and collect the results. |
4901 The block is called with n arguments for group of n consecutive elements in the receiver. |
4898 The block is called with n arguments for group of n consecutive elements in the receiver. |
4902 An error will be reported, if the number of elements in the receiver |
4899 An error will be reported, if the number of elements in the receiver |
4903 is not a multiple of n." |
4900 is not a multiple of n. |
|
4901 This is similar to slicesOf:collect:, but here, an N-arg block is expected." |
4904 |
4902 |
4905 |stop "{ Class:SmallInteger }" newCollection dstIdx argVector rslt| |
4903 |stop "{ Class:SmallInteger }" newCollection dstIdx argVector rslt| |
4906 |
4904 |
4907 stop := self size. |
4905 stop := self size. |
4908 newCollection := self copyEmptyAndGrow:stop // n. |
4906 newCollection := self copyEmptyAndGrow:stop // n. |
4952 |
4950 |
4953 inGroupsOf:n do:anNArgBlock |
4951 inGroupsOf:n do:anNArgBlock |
4954 "evaluate the argument, anNArgBlock for every group of n elements in the collection. |
4952 "evaluate the argument, anNArgBlock for every group of n elements in the collection. |
4955 The block is called with n arguments for group of n consecutive elements in the receiver. |
4953 The block is called with n arguments for group of n consecutive elements in the receiver. |
4956 An error will be reported, if the number of elements in the receiver |
4954 An error will be reported, if the number of elements in the receiver |
4957 is not a multiple of n." |
4955 is not a multiple of n. |
|
4956 This is similar to slicesOf:do:, but here, an N-arg block is expected." |
4958 |
4957 |
4959 |stop "{ Class:SmallInteger }" argVector| |
4958 |stop "{ Class:SmallInteger }" argVector| |
4960 |
4959 |
4961 stop := self size. |
4960 stop := self size. |
4962 |
4961 |
5274 slicesOf:n collect:aOneArgBlock |
5273 slicesOf:n collect:aOneArgBlock |
5275 "evaluate the argument, aOneArg for every slice of n elements of the collection, |
5274 "evaluate the argument, aOneArg for every slice of n elements of the collection, |
5276 and collect the results as instances of targetContainerClass. |
5275 and collect the results as instances of targetContainerClass. |
5277 The block is called with n element subcollections for groups of n consecutive elements in the receiver. |
5276 The block is called with n element subcollections for groups of n consecutive elements in the receiver. |
5278 If the number of elements in the receiver is not a multiple of n, the last block evaluation will |
5277 If the number of elements in the receiver is not a multiple of n, the last block evaluation will |
5279 get a short slice as argument" |
5278 get a short slice as argument. |
|
5279 This is similar to inGroupsOf:collect:, but here, a 1-arg block is expected." |
5280 |
5280 |
5281 |out| |
5281 |out| |
5282 |
5282 |
5283 out := self species writeStream. |
5283 out := self species writeStream. |
5284 self slicesOf:n do:[:slice | out nextPut:(aOneArgBlock value:slice)]. |
5284 self slicesOf:n do:[:slice | out nextPut:(aOneArgBlock value:slice)]. |
5295 |
5295 |
5296 slicesOf:n do:aOneArgBlock |
5296 slicesOf:n do:aOneArgBlock |
5297 "evaluate the argument, aOneArg for every slice of n elements of the collection. |
5297 "evaluate the argument, aOneArg for every slice of n elements of the collection. |
5298 The block is called with n element subcollections for groups of n consecutive elements in the receiver. |
5298 The block is called with n element subcollections for groups of n consecutive elements in the receiver. |
5299 If the number of elements in the receiver is not a multiple of n, the last block evaluation will |
5299 If the number of elements in the receiver is not a multiple of n, the last block evaluation will |
5300 get a short slice as argument" |
5300 get a short slice as argument. |
|
5301 This is similar to inGroupsOf:do:, but here, a 1-arg block is expected." |
5301 |
5302 |
5302 |i stop| |
5303 |i stop| |
5303 |
5304 |
5304 i := 1. stop := self size. |
5305 i := 1. stop := self size. |
5305 [i <= stop ] whileTrue:[ |
5306 [i <= stop ] whileTrue:[ |
6102 s'123defghijklmnop' |
6103 s'123defghijklmnop' |
6103 " |
6104 " |
6104 |
6105 |
6105 "Modified: / 20.5.1998 / 15:25:08 / cg" |
6106 "Modified: / 20.5.1998 / 15:25:08 / cg" |
6106 ! ! |
6107 ! ! |
|
6108 |
6107 |
6109 |
6108 !SequenceableCollection methodsFor:'obsolete'! |
6110 !SequenceableCollection methodsFor:'obsolete'! |
6109 |
6111 |
6110 randomizedQuickSortFrom:inBegin to:inEnd sortBlock:sortBlock with:aCollection |
6112 randomizedQuickSortFrom:inBegin to:inEnd sortBlock:sortBlock with:aCollection |
6111 "actual randomizedQuicksort worker for sort:with:-message. |
6113 "actual randomizedQuicksort worker for sort:with:-message. |
7259 ^ 0 |
7261 ^ 0 |
7260 |
7262 |
7261 "Created: 14.2.1997 / 16:13:03 / cg" |
7263 "Created: 14.2.1997 / 16:13:03 / cg" |
7262 ! ! |
7264 ! ! |
7263 |
7265 |
7264 |
|
7265 !SequenceableCollection methodsFor:'searching'! |
7266 !SequenceableCollection methodsFor:'searching'! |
7266 |
7267 |
7267 detect:aBlock startingAt:startIndex |
7268 detect:aBlock startingAt:startIndex |
7268 "find the first element, for which evaluation of the argument, aBlock returns true. |
7269 "find the first element, for which evaluation of the argument, aBlock returns true. |
7269 Start the search at startIndex. |
7270 Start the search at startIndex. |