OCLOperators oclIsTypeOf
No edit summary
(Replacing message template with parser tag)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<message>Write the content here to display this box</message>
=== oclIsTypeOf( typespec : Class ) : Boolean ===
=== 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''.
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''.
Line 14: Line 15:
|false
|false
|}
|}
[[Category:OCLOperators]]
Too check if an Object inherits from another type use [[OCLOperators oclIsKindOf]]
[[Category:OCL General Operators]]
{{Edited|July|12|2024}}

Latest revision as of 07:51, 17 June 2024

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 94 days ago on 06/17/2024. What links here