I am an abstract superclass for collections that have a well-defined order associated with their elements. Thus each element is externally-named by integers referred to as indices.
ProtoObjectObjectCollectionSequenceableCollection
- ArrayedCollection
- Heap
- Interval
- LinkedList
- MappedCollection
- OrderedCollection
instance | class |
---|---|
accessing
|
stream creation
|
converting |
---|
writeStream |
"SmallInterfaces: ##added for Squeak -M.U. 6/23/1999 23:35" ^WriteStream on: self |
testing |
---|
ends: aSequenceableCollection |
"Answer whether the last elements of aSequenceableCollection are equal to the elements of the reciever." ^self reverse starts: aSequenceableCollection reverse |
endsWith: aSequenceableCollectionOrObject |
"if aSequenceableCollectionOrObject is a <SequenceableCollection>, answer whether the last elements of the receiver, respectively, are equal to the elements of the <SequenceableCollection>. if aSequenceableCollectionOrObject is any other kind of object, answer whether the last element of the receiver equals to that <Object>." ^aSequenceableCollectionOrObject ends: self |
starts: aSequenceableCollection |
"Answer whether the first elements of aSequenceableCollection are equal to the elements of the reciever. <'in' starts: 'in the beginning...' >" (self isEmpty or: [aSequenceableCollection size < self size]) ifTrue: [^false]. 1 to: self size do: [:each | (aSequenceableCollection at: each) = (self at: each) ifFalse: [^false]]. ^true |