4 Collection classMethod!
10 Collection classMethod!
11 with: firstObject with: secondObject
17 Collection classMethod!
18 with: firstObject with: secondObject with: thirdObject
19 ^ (self new) add: firstObject;
24 Collection classMethod!
25 with: firstObject with: secondObject with: thirdObject with: fourthObject
37 self subclassResponsibility!
41 aCollection do: [ :each | self add: each ].
48 remove: anObject ifAbsent: anExceptionBlock
49 self subclassResponsibility!
53 ^ self remove: anObject ifAbsent: [self errorNotFound]!
56 removeAll: aCollection
57 aCollection do: [ :each | self remove: each ].
69 self do: [ :each | anObject = each ifTrue: [^ true]].
73 occurancesOf: anObject
76 self do: [ :each | anObject = each ifTrue: [ tally := tally + 1]].
86 self do: [ :each | tally := tally + 1].
91 self do: [ :el | ^ el]!
97 self subclassResponsibility!
102 newCollection := self species new.
103 self do: [ :each | newCollection add: (aBlock value: each)].
108 ^ self select: [ :element | (aBlock value: element) == false]!
113 newCollection := self species new.
114 self do: [ :each | (aBlock value: each) ifTrue: [newCollection add: each ]].
121 aStream nextPutAll: self class name.
122 aStream nextPutAll: ' ('.
129 ifTrue: ['...' printOn: aStream]
130 ifFalse: [el printOn: aStream].
132 ifTrue: [aStream nextPutAll: ' ']].
139 self error: 'Object is not in collection'!