Next: , Previous: SequenceableCollection class-instance creation, Up: SequenceableCollection


1.147.2 SequenceableCollection: basic

after: oldObject
Return the element after oldObject. Error if oldObject not found or if no following object is available


allButFirst
Answer a copy of the receiver without the first object.


allButFirst: n
Answer a copy of the receiver without the first n objects.


allButLast
Answer a copy of the receiver without the last object.


allButLast: n
Answer a copy of the receiver without the last n objects.


at: anIndex ifAbsent: aBlock
Answer the anIndex-th item of the collection, or evaluate aBlock and answer the result if the index is out of range


atAll: keyCollection
Answer a collection of the same kind returned by #collect:, that only includes the values at the given indices. Fail if any of the values in keyCollection is out of bounds for the receiver.


atAll: aCollection put: anObject
Put anObject at every index contained in aCollection


atAllPut: anObject
Put anObject at every index in the receiver


atRandom
Return a random item of the receiver.


before: oldObject
Return the element before oldObject. Error if oldObject not found or if no preceding object is available


first
Answer the first item in the receiver


first: n
Answer the first n items in the receiver


fourth
Answer the fourth item in the receiver


identityIncludes: anObject
Answer whether we include the anObject object


identityIndexOf: anElement
Answer the index of the first occurrence of an object identical to anElement in the receiver. Answer 0 if no item is found


identityIndexOf: anElement ifAbsent: exceptionBlock
Answer the index of the first occurrence of an object identical to anElement in the receiver. Invoke exceptionBlock and answer its result if no item is found


identityIndexOf: anElement startingAt: anIndex
Answer the first index > anIndex which contains an object identical to anElement. Answer 0 if no item is found


identityIndexOf: anObject startingAt: anIndex ifAbsent: exceptionBlock
Answer the first index > anIndex which contains an object exactly identical to anObject. Invoke exceptionBlock and answer its result if no item is found


identityIndexOfLast: anElement ifAbsent: exceptionBlock
Answer the last index which contains an object identical to anElement. Invoke exceptionBlock and answer its result if no item is found


includes: anObject
Answer whether we include anObject


indexOf: anElement
Answer the index of the first occurrence of anElement in the receiver. Answer 0 if no item is found


indexOf: anElement ifAbsent: exceptionBlock
Answer the index of the first occurrence of anElement in the receiver. Invoke exceptionBlock and answer its result if no item is found


indexOf: anElement startingAt: anIndex
Answer the first index > anIndex which contains anElement. Answer 0 if no item is found


indexOf: anElement startingAt: anIndex ifAbsent: exceptionBlock
Answer the first index > anIndex which contains anElement. Invoke exceptionBlock and answer its result if no item is found


indexOfLast: anElement ifAbsent: exceptionBlock
Answer the last index which contains anElement. Invoke exceptionBlock and answer its result if no item is found


indexOfSubCollection: aSubCollection
Answer the first index > anIndex at which starts a sequence of items matching aSubCollection. Answer 0 if no such sequence is found.


indexOfSubCollection: aSubCollection ifAbsent: exceptionBlock
Answer the first index > anIndex at which starts a sequence of items matching aSubCollection. Answer 0 if no such sequence is found.


indexOfSubCollection: aSubCollection startingAt: anIndex
Answer the first index > anIndex at which starts a sequence of items matching aSubCollection. Answer 0 if no such sequence is found.


indexOfSubCollection: aSubCollection startingAt: anIndex ifAbsent: exceptionBlock
Answer the first index > anIndex at which starts a sequence of items matching aSubCollection. Invoke exceptionBlock and answer its result if no such sequence is found


last
Answer the last item in the receiver


last: n
Answer the last n items in the receiver


second
Answer the second item in the receiver


third
Answer the third item in the receiver