Product Site

5.3. Collection Classes

A Collection is an object that contains a number of items, which can be any objects. Every item stored in a Collection has an associated index that you can use to retrieve the item from the collection with the at or [] methods.

Each Collection defines its own acceptable index types. Rexx provides the following Collection classes:
Array Class

A sequenced collection of objects ordered by whole-number indexes.
Bag Class

A collection where the index and the item are the same object. Bag indexes can be any object and each index can appear more than once.
CircularQueue Class

The CircularQueue class allows for storing objects in a circular queue of a predefined size. Once the end of the queue has been reached, new item objects are inserted from the beginning, replacing earlier entries. The collected objects can be processed in FIFO (first-in, first-out) or in a stack-like LIFO (last-in, first-out) order.
Directory Class

A collection with character string indexes. Index comparisons are performed using the string == comparison method.
IdentityTable Class

A collection with indexes that can be any object. The IdentityTable class determines index item matches by using an object identity comparison. With object identity matches, an index will only match the same object instance. An identity table contains no duplicate indexes.
List Class

A sequenced collection that lets you add new items at any position in the sequence. A list generates and returns an index value for each item placed in the list. The returned index remains valid until the item is removed from the list.
Properties Class

A collection with character string indexes and values. Properties collections include support for saving and loading from disk files.
Queue Class

A sequenced collection with the items ordered as a queue. You can remove items from the head of the queue and add items at either its tail or its head. Queues index the items with whole-number indexes, in the order in which the items would be removed. The current head of the queue has index 1, the item after the head item has index 2, up to the number of items in the queue.
Relation Class

A collection with indexes that can be any object. A relation can contain duplicate indexes.
Set Class

A collection where the index and the item are the same object. Set indexes can be any object and each index is unique.
Stem Class

A collection with character string indexes constructed from one or more string segments. Index comparisons are performed using the string == comparison method.
StringTable Class

A collection with character string indexes. Index comparisons are performed using the string == comparison method.
Table Class

A collection with indexes that can be any object. A table contains no duplicate indexes.