OCLOperators oclIsTypeOf
No edit summary
Line 14: Line 14:
|false
|false
|}
|}
Too check if a Type inherits from another type use [[OCLOperators oclIsKindOf]]
Too check if an Object inherits from another type use [[OCLOperators oclIsKindOf]]
[[Category:OCL General Operators]]
[[Category:OCL General Operators]]

Revision as of 12:38, 10 September 2023

oclIsTypeOf( typespec : Class ) : Boolean

Returns true if the type of self is the same as typespec - otherwise, returns false. This operation allows users to check the exact class type of self.

Expression Result
anEmployee.oclIsTypeOf(Employee) true
anEmployee.oclIsTypeOf(Person) false
aCat.oclIsTypeOf(Person) false

Too check if an Object inherits from another type use OCLOperators oclIsKindOf

This page was edited 83 days ago on 02/10/2024. What links here