OCLOperators oclIsKindOf
No edit summary
No edit summary
Line 1: Line 1:
=== oclIsKindOf( typespec : Class ) : Boolean ===
=== oclIsKindOf( typespec : Class ) : Boolean ===
Returns true if the type of ''self'' corresponds to the type or supertype of typespec, false otherwise. This operation allows users to check the class hierarchy of ''self'' much like would an instanceof Java.
Returns true if the type of ''self'' corresponds to the type or supertype of typespec - otherwise, returns false. This operation allows users to check the class hierarchy of ''self'' much like they would an instance of Java.
{| class="wikitable"
{| class="wikitable"
!Expression
!Expression

Revision as of 07:49, 3 March 2023

oclIsKindOf( typespec : Class ) : Boolean

Returns true if the type of self corresponds to the type or supertype of typespec - otherwise, returns false. This operation allows users to check the class hierarchy of self much like they would an instance of Java.

Expression Result
anEmployee.oclIsKindOf(Employee) true
anEmployee.oclIsKindOf(Person) true
aCat.oclIsKindOf(Person) false
This page was edited 93 days ago on 02/10/2024. What links here