Product SiteDocumentation Site

5.3.15. The Stem Class

A stem object is a collection with unique indexes that are character strings.

Table 5.25. ooRexx Stem Class

Object
Stem
+ MapCollection
 
= \= == \== <> ><
allIndexes
allItems
at, []
empty
hasIndex
hasItem
index
isEmpty
items
makeArray
put, []=
remove
removeItem
request
supplier
toDirectory
unknown

Note

The Stem 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 Map Collection (Section 5.3.3, “The MapCollection Class” class.
Stems are automatically created whenever a Rexx stem variable or Rexx compound variable is used. For example:

Example 5.173. Stem class - examples

a.1 = 2

creates a new stem collection with the name A. and assigns it to the Rexx variable A.; it also assigns the value 2 to entry 1 in the collection.
The value of an uninitialized stem index is the stem object NAME concatenated with the derived stem index.

Example 5.174. Stem class - examples

say a.[1,2]  -- implicitly creates stem object with name "A."
-- displays "A.1.2"

a = .stem~new("B.")
say a[1,2]     -- displays "B.1.2"

In addition to the items explicitly assigned to the collection indexes, a value may be assigned to all possible stem indexes. The []= method (with no index argument) will assign the target value to all possible stem indexes. Following assignment, a reference to any index will return the new value until another value is assigned or the index is dropped.
The [] method (with no index specified) will retrieve any globally assigned value. By default, this returns the stem NAME value.
In addition to the methods defined in the following, the Stem class removes the methods =, ==, \=, \==, <>, and >< using the DEFINE method.

5.3.15.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