OCLOperators oclAsType
(Replacing message template with parser tag)
No edit summary
Line 3: Line 3:
Returns ''self'' statically typed as typespec - if it is an instance of this type.  
Returns ''self'' statically typed as typespec - if it is an instance of this type.  


'''*Note*:''' this does not alter the runtime value of ''self -'' it only enables access to subtype operations. This operation allows users to cast ''self'' to another type.
'''NOTE:''' This does not alter the runtime value of ''self -'' it only enables access to subtype operations. This operation allows users to cast ''self'' to another type.
{| class="wikitable"
{| class="wikitable"
!Expression
!Expression

Revision as of 05:15, 16 December 2024

This page was created by Alexandra on 2017-08-13. Last edited by Edgar on 2025-01-20.

oclAsType ( typespec : Class ) : T

Returns self statically typed as typespec - if it is an instance of this type.

NOTE: This does not alter the runtime value of self - it only enables access to subtype operations. This operation allows users to cast self to another type.

Expression Result
aPerson.oclAsType(Employee) an object of Employee type