SequenceableCollection


Collections-Abstract

Comment:

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.

Hierarchy:

ProtoObject
Object
Collection
SequenceableCollection
  • ArrayedCollection
  • Heap
  • Interval
  • LinkedList
  • MappedCollection
  • OrderedCollection

Summary:

methods:

instance class
accessing
  • allButFirst
  • allButLast
  • anyOne
  • at:ifAbsent:
  • atAll:
  • atAll:put:
  • atAll:putAll:
  • atAllPut:
  • atPin:
  • atRandom
  • atRandom:
  • atWrap:
  • atWrap:put:
  • fifth
  • first
  • fourth
  • identityIndexOf:
  • identityIndexOf:ifAbsent:
  • indexOf:
  • indexOf:ifAbsent:
  • indexOf:startingAt:ifAbsent:
  • indexOfSubCollection:startingAt:
  • indexOfSubCollection:startingAt:ifAbsent:
  • last
  • middle
  • replaceAll:with:
  • replaceFrom:to:with:
  • replaceFrom:to:with:startingAt:
  • second
  • sixth
  • size
  • smartInspect
  • third
comparing
  • =
  • hasEqualElements:
  • hash
converting
  • @
  • asArray
  • asDictionary
  • asFloatArray
  • asIntegerArray
  • asSortedArray
  • asStringWithCr
  • asWordArray
  • isSequenceable
  • reversed
  • writeStream
copying
  • ,
  • copyAfterLast:
  • copyAt:put:
  • copyFrom:to:
  • copyLast:
  • copyReplaceAll:with:
  • copyReplaceFrom:to:with:
  • copyUpTo:
  • copyUpToLast:
  • copyWith:
  • copyWithout:
  • copyWithoutAll:
  • forceTo:paddingWith:
  • shallowCopy
  • shuffled
  • shuffledBy:
  • sortBy:
enumerating
  • asDigitsToPower:do:
  • collect:
  • collect:from:to:
  • collectWithIndex:
  • combinations:atATimeDo:
  • do:
  • do:without:
  • doWithIndex:
  • findFirst:
  • findLast:
  • keysAndValuesDo:
  • pairsCollect:
  • pairsDo:
  • permutationsDo:
  • reverseDo:
  • reverseWith:do:
  • select:
  • with:collect:
  • with:do:
  • withIndexCollect:
  • withIndexDo:
private
  • asDigitsAt:in:do:
  • combinationsAt:in:after:do:
  • copyReplaceAll:with:asTokens:
  • errorOutOfBounds
  • permutationsStartingAt:do:
  • swap:with:
removing
  • remove:ifAbsent:
testing
stream creation
  • streamContents:
  • streamContents:limitedTo:

Detail:

instance methods:

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

class methods:

^top


- made by Dandelion -