Create a new class which specialises and existing class
ADD_METHOD | class=String superclass=String [comment=String] [names=String] | Create a subclass specialising an existing class |
example:
# Create a specialised Triple axis workspace class >> [ Subclass(class="My_Triple_axis", superclass="Triple_axis", & comment="Specialised TA workspace", names="f4") ] >> ta_spec1 = Create("Triple_axis") # create a spectrum >> ta_spec2 = Create("My_Triple_axis") # create a spectrum >> Printn ta_spec1 Triple_axis [TA class comment] ( f2 = _ f3 = _ f1 = _ ) >> Printn ta_spec2 Triple_axis [Specialised TA workspace] ( f4 = _ f2 = _ f3 = _ f1 = _ )
Note: by default, method is given the same name as the procedure
This is the way in which Open GENIE allows the addition of specialised (inherited) classes. All that is needed to create a subclass of an existing class is to specify the extra attributes which belong to the subclass only. The Subclass() function is the function used to do this.
Class (String)
The name of the class to to create.
Superclass (String) [ default = "Structure" ]
The name of the class from which to inherit.
Comment (String)
Short comment describing the function of the class - will be seen in the Hierarchy() command.
Names (String)
A space separated list of names giving the field names of the attributes for the new class.