Bag.st
branchjv
changeset 18017 7fef9e17913f
parent 18011 deb0c3355881
parent 14685 43b852db6777
child 18037 4cf874da38c9
--- a/Bag.st	Wed Jan 23 10:08:55 2013 +0000
+++ b/Bag.st	Mon Jan 28 21:53:19 2013 +0000
@@ -106,7 +106,7 @@
      to the bags elements. 
      Same as #contents for dolphin compatibility."
 
-    ^ contents
+    ^ self contents
 ! !
 
 !Bag methodsFor:'accessing'!
@@ -356,8 +356,8 @@
 !Bag methodsFor:'printing & storing'!
 
 printElementsDo:aBlock
-    contents keysAndValuesDo:[:key :value|
-        aBlock value:('%1(*%2)' bindWith:key with:value).
+    self valuesAndCountsDo:[:value :count|
+        aBlock value:('%1(*%2)' bindWith:value with:count).
     ]
 ! !
 
@@ -404,7 +404,7 @@
 includes:anObject
     "return true, if anObject is in the receiver"
 
-    ^ contents includesKey:anObject
+    ^ (self occurrencesOf:anObject) > 0
 !
 
 occurrencesOf:anObject
@@ -416,9 +416,10 @@
 !Bag class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.41 2010-03-30 13:38:23 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.42 2013-01-23 17:14:50 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.41 2010-03-30 13:38:23 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.42 2013-01-23 17:14:50 cg Exp $'
 ! !
+