Bundle Typed tuple classes (Pair, Triple, Quad) for grouping related values without defining a class. Immutable by design; use as map keys or return values. Compile with -lib gen_collect.
Triplet
Tuple class that supports 3 values
triplet := Collection.Tuple.Triplet->New("Alice", 30, true)<String, IntRef, BoolRef>;
triplet->GetFirst()->PrintLine();
triplet->GetSecond()->PrintLine();
triplet->GetThird()->PrintLine();Operations
GetFirst #
Returns the first value
method : public : GetFirst() ~ AReturn
| Type | Description |
|---|---|
| A | first value |
Example
t := Collection.Tuple.Triplet->New("Alice", 30, true)<String, IntRef, BoolRef>;
t->GetFirst()->PrintLine(); # AliceGetSecond #
Returns the second value
method : public : GetSecond() ~ BReturn
| Type | Description |
|---|---|
| B | second value |
Example
t := Collection.Tuple.Triplet->New("Alice", 30, true)<String, IntRef, BoolRef>;
t->GetSecond()->PrintLine(); # 30GetThird #
Returns the third value
method : public : GetThird() ~ CReturn
| Type | Description |
|---|---|
| C | third value |
Example
t := Collection.Tuple.Triplet->New("Alice", 30, true)<String, IntRef, BoolRef>;
t->GetThird()->PrintLine(); # trueNew # constructor
Constructor.
New(a:A, b:B, c:C)Parameters
| Name | Type | Description |
|---|---|---|
| a | A | first parameter |
| b | B | second parameter |
| c | C | third parameter |
Example
t := Collection.Tuple.Triplet->New("Alice", 30, true)<String, IntRef, BoolRef>;
t->GetFirst()->PrintLine(); # Alice
t->GetSecond()->PrintLine(); # 30
t->GetThird()->PrintLine(); # true