Next: , Previous: SequenceableCollection-copying SequenceableCollections, Up: SequenceableCollection


1.147.6 SequenceableCollection: enumerating

anyOne
Answer an unspecified element of the collection.


do: aBlock
Evaluate aBlock for all the elements in the sequenceable collection


do: aBlock separatedBy: sepBlock
Evaluate aBlock for all the elements in the sequenceable collection. Between each element, evaluate sepBlock without parameters.


doWithIndex: aBlock
Evaluate aBlock for all the elements in the sequenceable collection, passing the index of each element as the second parameter. This method is mantained for backwards compatibility and is not mandated by the ANSI standard; use #keysAndValuesDo:


findFirst: aBlock
Returns the index of the first element of the sequenceable collection for which aBlock returns true, or 0 if none


findLast: aBlock
Returns the index of the last element of the sequenceable collection for which aBlock returns true, or 0 if none does


fold: binaryBlock
First, pass to binaryBlock the first and second elements of the receiver; for each subsequent element, pass the result of the previous evaluation and an element. Answer the result of the last invocation, or the first element if the collection has size 1. Fail if the collection is empty.


from: startIndex to: stopIndex do: aBlock
Evaluate aBlock for all the elements in the sequenceable collection whose indices are in the range index to stopIndex


from: startIndex to: stopIndex doWithIndex: aBlock
Evaluate aBlock for all the elements in the sequenceable collection whose indices are in the range index to stopIndex, passing the index of each element as the second parameter. This method is mantained for backwards compatibility and is not mandated by the ANSI standard; use #from:to:keysAndValuesDo:


from: startIndex to: stopIndex keysAndValuesDo: aBlock
Evaluate aBlock for all the elements in the sequenceable collection whose indices are in the range index to stopIndex, passing the index of each element as the first parameter and the element as the second.


keys
Return an Interval corresponding to the valid indices in the receiver.


keysAndValuesDo: aBlock
Evaluate aBlock for all the elements in the sequenceable collection, passing the index of each element as the first parameter and the element as the second.


readStream
Answer a ReadStream streaming on the receiver


readWriteStream
Answer a ReadWriteStream which streams on the receiver


reverse
Answer the receivers' contents in reverse order


reverseDo: aBlock
Evaluate aBlock for all elements in the sequenceable collection, from the last to the first.


with: aSequenceableCollection collect: aBlock
Evaluate aBlock for each pair of elements took respectively from the re- ceiver and from aSequenceableCollection; answer a collection of the same kind of the receiver, made with the block's return values. Fail if the receiver has not the same size as aSequenceableCollection.


with: aSequenceableCollection do: aBlock
Evaluate aBlock for each pair of elements took respectively from the re- ceiver and from aSequenceableCollection. Fail if the receiver has not the same size as aSequenceableCollection.