PrimitiveTypes
A number of primitive types have been defined for use in the
specification of the UML metamodel. These include prmitive types such
as Integer, Boolean, and String. These types are reused by both MOF and
UML, and may potentially be reused also in user models. Tool vendors,
however, typically provide their own libraries of data types to be used
when modeling with UML.
The contents of the PrimitiveTypes package is shown in Figure 422. The
PrimitiveTypes package is one of the packages of the
AuxiliaryConstructs package.
Boolean (from PrimitiveTypes)
A boolean type is used for logical expression, consisting of the
predefined values true and false.
Description
Boolean is an instance of PrimitiveType. In the metamodel, Boolean
defines an enumeration that denotes a logical condition. Its
enumeration literals are:
- true The Boolean condition is satisfied.
- false The Boolean condition is not satisfied.
It is used for boolean attribute and boolean expressions in the
metamodel, such as OCL expression.
Attributes
No additional attributes.
Associations
No additional associations.
Constraints
No additional constraints.
Semantics
Boolean is an instance of PrimitiveType.
Notation
Boolean will appear as the type of attributes in the metamodel.
Boolean instances will be values associated to slots, and can have
literally the following values : true, or false.
Examples
Integer (from PrimitiveTypes)
An integer is a primitive type representing integer values.
Description
An instance of Integer is an element in the (infinite) set of
integers (...-2, -1, 0, 1, 2...). It is used for integer attributes and
integer expressions in the metamodel.
Attributes
No additional attributes.
Associations
No additional associations.
Constraints
No additional constraints.
Semantics
Integer is an instance of PrimitiveType.
Notation
Integer will appear as the type of attributes in the metamodel.
Integer instances will be values associated to slots such as 1, -5, 2,
34, 26524, etc.
Examples
String (from PrimitiveTypes)
A string is a sequence of characters in some suitable character set
used to display information about the model. Character sets may include
non-Roman alphabets and characters.
Description
An instance of String defines a piece of text. The semantics of the
string itself depends on its purpose, it can be a comment,
computational language expression, OCL expression, etc. It is used for
String attributes and String expressions in the metamodel.
Attributes
No additional attributes.
Associations
No additional associations.
Constraints
No additional constraints.
Semantics
String is an instance of PrimitiveType.
Notation
String appears as the type of attributes in the metamodel. String
instances are values associated to slots. The value is a sequence of
characters surrounded by double quotes ("). It is assumed that the
underlying character set is sufficient for representing multibyte
characters in various human languages; in particular, the traditional
8-bit ASCII character set is insufficient. It is assumed that tools and
computers manipulate and store strings correctly, including escape
conventions for special characters, and this document will assume that
arbitrary strings can be used.
A string is displayed as a text string graphic. Normal printable
characters should be displayed directly. The display of nonprintable
characters is unspecified and platform-dependent.
Examples
UnlimitedNatural (from PrimitiveTypes)
An unlimited natural is a primitive type representing unlimited natural
values.
Description
An instance of UnlimitedNatural is an element in the (infinite) set
of naturals (0, 1, 2...). The value of infinity is shown using an
asterisk (`*').
Attributes
No additional attributes.
Associations
No additional associations.
Constraints
No additional constraints.
Semantics
UnlimitedNatural is an instance of PrimitiveType.
Notation
UnlimitedNatural will appear as the type of upper bounds of
multiplicities in the metamodel. UnlimitedNatural instances will be
values associated to slots such as 1, 5, 398475, etc. The value
infinity may be shown using an asterisk (`*').
Examples