ProtoObjectObjectCollectionSet
- Dictionary
- DlSortedSet
- IdentitySet
- PluggableSet
| array | tally |
| instance | class |
|---|---|
accessing
|
initialization
|
| array |
|---|
|
|
| tally |
|---|
|
|
| adding |
|---|
| , aCollection |
"Answer a copy of the receiver concatenated with the argument, aCollection." ^self copy addAll: aCollection asSet; yourself |
| removing |
|---|
| - aSet |
"Answer those elements present in the receiver and absent from aSet." "SmallInterfaces: ##added for Squeak -M.U. 6/23/1999 23:35" ^self reject: [ :i | aSet includes: i ] |
| set operations |
|---|
| & aSet |
"Set intersection" ^self intersectionWith: aSet |
| + aCollection |
"Set union" ^self , aCollection |
| intersectionWith: aSet |
"Intersection of two sets." ^self select: [:each | aSet includes: each] |
| intersectionWithSet: aSet |
"Return the elements in common with receiver and aSet as a set with one instance of each element. <#(1 2 3) asSet intersectionWithSet: #(2 3 4) asSet>" ^(self size <= aSet size) ifTrue: [self select: [:each | aSet includes: each]] ifFalse: [aSet intersectionWithSet: self] |