Category: Collections-Sequenceable
Superclass: SequenceableCollection
My instances represent ordered collections of arbitrary typed objects which are not directly accessible by an index. They can be accessed indirectly through an index, and can be manipulated by adding to the end or based on content (such as add:after:)

Method category index

instance creation (class)
accessing (instance)
adding (instance)
built ins (instance)
enumerating (instance)
removing (instance)

instance creation (class)

new
Answer an OrderedCollection of default size

new: anInteger

Answer an OrderedCollection of size anInteger

top


accessing (instance)

at: anIndex
Answer the anIndex-th item of the receiver

at: anIndex put: anObject

Store anObject at the anIndex-th item of the receiver, answer anObject

first

Answer the first item of the receiver

last

Answer the last item of the receiver

size

Return the number of objects in the receiver

top


adding (instance)

add: anObject
Add anObject in the receiver, answer it

add: newObject after: oldObject

Add newObject in the receiver just after oldObject, answer it. Fail if oldObject can't be found

add: newObject afterIndex: i

Add newObject in the receiver just after the i-th, answer it. Fail if i < 0 or i > self size

add: newObject before: oldObject

Add newObject in the receiver just before oldObject, answer it. Fail if oldObject can't be found

add: newObject beforeIndex: i

Add newObject in the receiver just before the i-th, answer it. Fail if i < 1 or i > self size + 1

addAll: aCollection

Add every item of aCollection to the receiver, answer it

addAll: newCollection after: oldObject

Add every item of newCollection to the receiver just after oldObject, answer it. Fail if oldObject is not found

addAll: newCollection afterIndex: i

Add every item of newCollection to the receiver just after the i-th, answer it. Fail if i < 0 or i > self size

addAll: newCollection before: oldObject

Add every item of newCollection to the receiver just before oldObject, answer it. Fail if oldObject is not found

addAll: newCollection beforeIndex: i

Add every item of newCollection to the receiver just before the i-th, answer it. Fail if i < 1 or i > self size + 1

addAllFirst: aCollection

Add every item of newCollection to the receiver right at the start of the receiver. Answer aCollection

addAllLast: aCollection

Add every item of newCollection to the receiver right at the end of the receiver. Answer aCollection

addFirst: newObject

Add newObject to the receiver right at the start of the receiver. Answer newObject

addLast: newObject

Add newObject to the receiver right at the end of the receiver. Answer newObject

top


built ins (instance)

primReplaceFrom: start to: stop with: byteArray startingAt: replaceStart
Replace the characters from start to stop with new characters whose ASCII codes are contained in byteArray, starting at the replaceStart location of byteArray

top


enumerating (instance)

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

top


removing (instance)

identityRemove: oldObject
Remove oldObject from the receiver. If absent, fail, else answer oldObject.

identityRemove: anObject ifAbsent: aBlock

Remove anObject from the receiver. If it can't be found, answer the result of evaluating aBlock

remove: anObject ifAbsent: aBlock

Remove anObject from the receiver. If it can't be found, answer the result of evaluating aBlock

removeAtIndex: anIndex

Remove the object at index anIndex from the receiver. Fail if the index is out of bounds.

removeFirst

Remove an object from the start of the receiver. Fail if the receiver is empty

removeLast

Remove an object from the end of the receiver. Fail if the receiver is empty

top