Product SiteDocumentation Site

5.3.7. The Bag Class

A bag is a non-sparse collection that restricts the elements to having an item that is the same as the index. Any object can be placed in a bag, and the same object can be placed in a bag several times.

Table 5.17. ooRexx Bag Class

Object
Relation
+ MapCollection
Bag
+ SetCollection
of
difference
hasIndex
hasItem
intersection
put, []=
putAll
subset
union
xor

Note

The Bag class also has available class methods that its metaclass, the Class class (Section 5.1.2, “The Class Class”), defines. It also inherits methods from the Set Collection (Section 5.3.5, “The SetCollection Class”) class, although there are not currently any methods defined in that class.
The Bag class is a subclass of the Relation class. In addition to its own methods, it inherits the methods of the Object class and the Relation class.

5.3.7.1. Inherited Methods

Methods inherited from the Object class (Section 5.1.1, “The Object Class”).
new (Class Method)initsend
= \= == \== <> ><instanceMethodsendWith
|| '' (abuttal)' ' (blank)instanceMethodssetMethod
(Operator Methods)isAstart
classisInstanceOfstartWith
copyobjectNamestring
defaultNameobjectName=unsetMethod
hasMethodrequest 
identityHashrun 
Methods inherited from the Collection class (Section 5.3.2, “The Collection Class”).
[]equivalentput
[]=hasIndexsubset
allIndexeshasItemsupplier
allItemsindexunion
atintersectionxor
differenceitems 
disjointmakeArray 
Methods inherited from the MapCollection class (Section 5.3.3, “The MapCollection Class”).
putAll  
Methods inherited from the Relation class (Section 5.3.13, “The Relation Class”).
new (Class Method)hasIndexremove
allAthasItemremoveAll
allIndexindexremoveItem
allIndexesintersectionsubset
allItemsisEmptysupplier
atitemsunion
[]makeArrayxor
differenceput 
empty[]=