Bag.st
changeset 11481 9da83b7e8c57
parent 11474 f4c8118aab2c
child 11490 cfb0dc5cc606
equal deleted inserted replaced
11480:9608377252d6 11481:9da83b7e8c57
   123     "return the dictionary which associates occurrence-counts
   123     "return the dictionary which associates occurrence-counts
   124      to the bags elements."
   124      to the bags elements."
   125 
   125 
   126     ^ contents
   126     ^ contents
   127 ! !
   127 ! !
   128 
       
   129 
   128 
   130 !Bag methodsFor:'adding & removing'!
   129 !Bag methodsFor:'adding & removing'!
   131 
   130 
   132 add:newObject
   131 add:newObject
   133     "add the argument, anObject to the receiver.
   132     "add the argument, anObject to the receiver.
   319 
   318 
   320     "Modified: 1.3.1996 / 21:42:39 / cg"
   319     "Modified: 1.3.1996 / 21:42:39 / cg"
   321 !
   320 !
   322 
   321 
   323 valuesAndCounts
   322 valuesAndCounts
   324     "return an orderedCollection containing value->count assocuations"
   323     "return an orderedCollection containing value->count associations"
   325 
   324 
   326     |coll|
   325     |coll|
   327 
   326 
   328     coll := OrderedCollection new.
   327     coll := OrderedCollection new.
   329     self valuesAndCountsDo:[:value :count | coll add:(value->count)].
   328     self valuesAndCountsDo:[:value :count | coll add:(value->count)].
   397 ! !
   396 ! !
   398 
   397 
   399 !Bag class methodsFor:'documentation'!
   398 !Bag class methodsFor:'documentation'!
   400 
   399 
   401 version
   400 version
   402     ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.35 2009-01-16 13:35:44 cg Exp $'
   401     ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.36 2009-01-19 12:17:26 cg Exp $'
   403 ! !
   402 ! !