'From PharoCore1.0rc1 of 19 October 2009 [Latest update: #10498] on 1 December 2009 at 6:41:39 pm'! !TIndexAccess methodsFor: 'tests - index access' stamp: 'CesarRabak 11/30/2009 18:29'! testIntegerIndex "self debug: #testIntegerIndex" | collection | collection := self collectionMoreThan1NoDuplicates. self should: [collection at: 2.2] raise: Error! ! !TPutTest methodsFor: 'tests - puting with indexes' stamp: 'CesarRabak 12/1/2009 18:10'! testIntegerAtPut "self debug: #testIntegerAtPut" self should: [self nonEmpty at: 2.2 put: self aValue] raise: Error ! ! !Object methodsFor: 'accessing' stamp: 'CesarRabak 11/30/2009 18:34'! at: index "Primitive. Assumes receiver is indexable. Answer the value of an indexable element in the receiver. Fail if the argument index is not an Integer or is out of bounds. Essential. See Object documentation whatIsAPrimitive." index isInteger ifTrue: [self class isVariable ifTrue: [self errorSubscriptBounds: index] ifFalse: [self errorNotIndexable]]. self errorNonIntegerIndex! ! !Object methodsFor: 'accessing' stamp: 'CesarRabak 11/30/2009 19:54'! at: index put: value "Primitive. Assumes receiver is indexable. Store the argument value in the indexable element of the receiver indicated by index. Fail if the index is not an Integer or is out of bounds. Or fail if the value is not of the right type for this kind of collection. Answer the value that was stored. Essential. See Object documentation whatIsAPrimitive." index isInteger ifTrue: [self class isVariable ifTrue: [(index between: 1 and: self size) ifTrue: [self errorImproperStore] ifFalse: [self errorSubscriptBounds: index]] ifFalse: [self errorNotIndexable]]. self errorNonIntegerIndex! ! !Object methodsFor: 'accessing' stamp: 'CesarRabak 11/30/2009 19:11'! basicAt: index "Primitive. Assumes receiver is indexable. Answer the value of an indexable element in the receiver. Fail if the argument index is not an Integer or is out of bounds. Essential. Do not override in a subclass. See Object documentation whatIsAPrimitive." index isInteger ifTrue: [self errorSubscriptBounds: index]. self errorNonIntegerIndex! ! !Object methodsFor: 'accessing' stamp: 'CesarRabak 12/1/2009 18:30'! basicAt: index put: value "Primitive. Assumes receiver is indexable. Store the second argument value in the indexable element of the receiver indicated by index. Fail if the index is not an Integer or is out of bounds. Or fail if the value is not of the right type for this kind of collection. Answer the value that was stored. Essential. Do not override in a subclass. See Object documentation whatIsAPrimitive." index isInteger ifTrue: [(index between: 1 and: self size) ifTrue: [self errorImproperStore] ifFalse: [self errorSubscriptBounds: index]]. self errorNonIntegerIndex! ! !Interval methodsFor: 'accessing' stamp: 'CesarRabak 11/30/2009 19:18'! at: anInteger "Answer the anInteger'th element." anInteger isInteger ifFalse: [self errorNonIntegerIndex]. (anInteger between: 1 and: self size) ifTrue: [^start + (step * (anInteger - 1))] ifFalse: [self errorSubscriptBounds: anInteger]! ! !OrderedCollection methodsFor: 'accessing' stamp: 'CesarRabak 11/30/2009 23:53'! at: anInteger put: anObject "Put anObject at element index anInteger. at:put: cannot be used to append, front or back, to an ordered collection; it is used by a knowledgeable client to replace an element." anInteger isInteger ifFalse: [self errorNonIntegerIndex]. (anInteger < 1 or: [anInteger + firstIndex - 1 > lastIndex]) ifTrue: [self errorNoSuchElement] ifFalse: [^array at: anInteger + firstIndex - 1 put: anObject]! !