An IdentityBag is an unordered collection of objects. In some languages it is referred to as a counted set. A Bag keeps track of the number of times objects are inserted and requires that objects be removed the same number of times. There is only one instance of an object in a Bag even if the object has been added to the Bag multiple times (test is for identity).
The contents of a IdentityBag are unordered. You must not depend on the order of items in a set.
Add anObject to the Bag. A Bag may contain multiple entries of the same object.
Remove anObject from the IdentityBag.
Returns the dictionary that stores the objects in pairs (obj -> numberOfObjects)
Evaluates function for each item in the IdentityBag. The function is passed two arguments, the item and an integer index.