OCLOperators oclIsTypeOf
No edit summary
No edit summary
Line 1: Line 1:
Returns true if
=== oclIsTypeOf( typespec : Class ) : Boolean ===
Returns true if the type of ''self'' is the same as typespec, or false otherwise. This operation allows users to check the exact class type of ''self''.
{| class="wikitable"
!Expression
!Result
|-
|anEmployee.oclIsTypeOf(Employee)
|true
|-
|anEmployee.oclIsTypeOf(Person)
|false
|-
|aCat.oclIsTypeOf(Person)
|false
|}
[[Category:OCLOperators]]
[[Category:OCLOperators]]

Revision as of 21:56, 15 October 2019

oclIsTypeOf( typespec : Class ) : Boolean

Returns true if the type of self is the same as typespec, or false otherwise. 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
This page was edited 83 days ago on 02/10/2024. What links here