Bag.st
changeset 5375 ed4815509a57
parent 1422 9a0b792f2953
child 5557 f5f8d236027c
--- a/Bag.st	Fri Apr 14 18:44:05 2000 +0200
+++ b/Bag.st	Fri Apr 14 21:32:50 2000 +0200
@@ -10,6 +10,8 @@
  hereby transferred.
 "
 
+"{ Package: 'stx:libbasic' }"
+
 Collection subclass:#Bag
 	instanceVariableNames:'contents'
 	classVariableNames:''
@@ -71,6 +73,13 @@
     ^ super new initContents:size
 !
 
+identityNew
+    "return a new empty Bag which compares for identity
+     Elements will be compared using identity compare (i.e. #== not #= equality)."
+
+    ^ super new initContentsForIdentity
+!
+
 identityNew:size
     "return a new empty Bag with initial space for size elements.
      Elements will be compared using identity compare (i.e. #== not #= equality)."
@@ -271,6 +280,12 @@
     contents := Dictionary new:size
 !
 
+initContentsForIdentity
+    "set the contents to be an empty IdentityDictionary"
+
+    contents := IdentityDictionary new
+!
+
 initContentsForIdentity:size
     "set the contents to be an empty IdentityDictionary with initial size"
 
@@ -304,5 +319,5 @@
 !Bag class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.24 1996-05-18 15:24:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.25 2000-04-14 19:32:50 cg Exp $'
 ! !