EXTEND CLASS statement
The EXTEND CLASS statement extends an existing class.
Syntax
EXTEND CLASS name
[{
objectName1 [objectCaption1] [imageSetting],
...
objectNameM [objectCaptionM] [imageSetting]
}]
[: parent1, ..., parentN];
Where imageSetting is one of:
IMAGE [imageLiteral]
NOIMAGE
Description
The EXTEND CLASS statement extends an existing custom class with additional parent classes and new static objects. You can also extend abstract classes by adding parent classes to them.
Parameters
-
nameClass name. A composite ID.
-
objectName1, ..., objectNameMNames of new static objects of the specified class. Each name is defined by a simple ID. The name of each static object is available through the
name[StaticObject]property. -
objectCaption1, ..., objectCaptionMCaptions of new static objects of the specified class. Each caption is a string literal. If the caption is not defined, the name of the static object will be its caption. The caption of each static object is available through the
caption[StaticObject]property. -
imageSettingIcon setting for a static object. One of:
-
IMAGEManual icon specification, optionally followed by
imageLiteral— a string literal whose value defines the icon. IfimageLiteralis omitted, the automatic assignment mode is enabled. -
NOIMAGEThe static object has no icon.
-
-
parent1, ..., parentNA list of names of new parent classes. Each name is defined by a composite ID.
Examples
CLASS ABSTRACT Shape;
CLASS Box : Shape;
CLASS Quadrilateral;
EXTEND CLASS Box : Quadrilateral; // Adding inheritance
CLASS ShapeType {
point 'Dot',
segment 'Line segment'
}
EXTEND CLASS ShapeType { // Adding a static object
circle 'Circle'
}