'From Squeak3.6 of ''6 October 2003'' [latest update: #5424] on 18 February 2004 at 1:39:08 am'! OrderedCollection subclass: #Owner instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Category-YukiQuiz'! !Integer methodsFor: 'As I was going to St. Ives' stamp: 'sumim 2/18/2004 01:19'! cats ^ self ownees! ! !Integer methodsFor: 'As I was going to St. Ives' stamp: 'sumim 2/18/2004 01:19'! kits ^ self ownees! ! !Integer methodsFor: 'As I was going to St. Ives' stamp: 'sumim 2/18/2004 01:18'! ownees | ownees | ownees _ Array new: self. 1 to: self do: [ : index | ownees at: index put: Owner new ]. ^ Owner withAll: ownees! ! !Integer methodsFor: 'As I was going to St. Ives' stamp: 'sumim 2/18/2004 01:19'! sacks ^ self ownees! ! !Integer methodsFor: 'As I was going to St. Ives' stamp: 'sumim 2/18/2004 01:19'! wives ^ self ownees! ! !Owner methodsFor: 'As I was going to St. Ives' stamp: 'sumim 2/18/2004 01:04'! had: anCollection ^ self addAll: anCollection! ! !Owner methodsFor: 'As I was going to St. Ives' stamp: 'sumim 2/18/2004 01:12'! howManyCompanions ^ self inject: 1 into: [ : sum : each | sum + each howManyCompanions ]! ! !Owner class methodsFor: 'examples' stamp: 'sumim 2/18/2004 01:22'! example | man | man := Owner new. (man had: 7 wives) do: [ : eachWife | (eachWife had: 7 sacks) do: [ : eachSack | (eachSack had: 7 cats) do: [ : eachCat | eachCat had: 7 kits ]]]. ^ man howManyCompanions! !