01_user_documentation:07_rgg_xl:02_xl:08_object:01_module:01_declaration:09_super_private
Super private attributes
To be able to deal with situations where we want to use a field of a superclass as a parameter, but do only have access to this field via get- and set-methods (due to restricted visibility or even because the value is not stored directly in a field, but by some other mechanism), we have to specify the get-method in the declaration of the parameter:
module X { private float a; float getA(){} void setA(float a){} }; // private field module Y(float a return getA()) extends X.(setA(a)); //is equivalent to: class Y extends X { public Y(float val){ super(); setA(val); } ... // pattern }
As you see the method getA() is not actually used. It only serve as placeholder for the syntax. The method has to be declared though.
01_user_documentation/07_rgg_xl/02_xl/08_object/01_module/01_declaration/09_super_private.txt · Last modified: 2025/09/04 16:44 by gaetan
