Chaining
Chaining¶
Multiple calls, member accesses, and indexed accesses can be chained together. Let us first look at the declaration of the class we need for the example:
This is a class LinearRegression
, which has a constructor and an instance method called drawAsGraph
.
We can then use those declarations in a segment:
This segment is called mySegment
and has a parameter regressions
of type List<LinearRegression>
.
In the body of the segment we then
- access the first instance in the list using an indexed access,
- access the instance method
drawAsGraph
of this instance using a member access, - call this method.