Object::IsInstanceOf(aClass) ‚ÍAˆø”‚ɃNƒ‰ƒX(aClass)‚ðŽæ‚èA‚ ‚éƒCƒ“ƒXƒ^ƒ“ƒX‚ª‚»‚̃Nƒ‰ƒX‚©‚綬‚³‚ꂽ‚à‚Ì‚©‚Ç‚¤‚©‚Ì^‹U’l‚ð•Ô‚µ‚Ü‚·B
aClass‚ªƒCƒ“ƒXƒ^ƒ“ƒX‚̶¬Œ³ƒNƒ‰ƒXA‚ ‚é‚¢‚ÍA¶¬Œ³ƒNƒ‰ƒX‚̃X[ƒp[ƒN ƒ‰ƒX‚Å‚ ‚éꇂÉ^‚Æ‚È‚è‚Ü‚·B
Šî–{ƒf[ƒ^Œ^‚ɑ΂·‚éƒJƒvƒZƒ‹ƒNƒ‰ƒX‚̃`ƒFƒbƒN‚às‚¦‚Ü‚·B
—Ⴆ‚ÎA‰º‹L‚̂悤‚ȃNƒ‰ƒXA,B,C‚ÆA‚»‚̃Cƒ“ƒXƒ^ƒ“ƒXa,b,c‚ª‚ ‚éê‡A
class A { .. }
class B : A { .. }
class C : A { .. }
var a = new A, b = new B, c = new C ;
ŠeƒCƒ“ƒXƒ^ƒ“ƒX‚É‚¨‚¯‚éAIsInstanceOf() ‚Ì^‹U’l‚͈ȉº‚Ì‚æ ‚¤‚É‚È‚è‚Ü‚·B
a->IsInstanceOf(A) |
![]() |
^ |
a->IsInstanceOf(B) |
![]() |
‹U |
a->IsInstanceOf(C) |
![]() |
‹U |
b->IsInstanceOf(A) |
![]() |
^ |
b->IsInstanceOf(B) |
![]() |
^ |
b->IsInstanceOf(C) |
![]() |
‹U |
c->IsInstanceOf(A) |
![]() |
^ |
c->IsInstanceOf(B) |
![]() |
‹U |
c->IsInstanceOf(C) |
![]() |
^ |
‚Ü‚½AŠî–{ƒf[ƒ^Œ^‚ÉŠÖ‚µ‚Ä‚ÍA‰º‹L‚̃f[ƒ^Œ^‚ƃJƒvƒZƒ‹ƒNƒ‰ƒX‚Ì‘g‡‚¹‚Ì ‚Ý^‚Æ‚È‚è‚Ü‚·B
void->IsInstanceOf( Void) |
<®”’l>->IsInstanceOf( Integer) |
<ŽÀ”’l>->IsInstanceOf( Real) |
<•¶Žš—ñ’l>->IsInstanceOf( String) |
<ƒVƒ“ƒ{ƒ‹’l>->IsInstanceOf( Symbol) |
<”z—ñ’l>->IsInstanceOf( Array) |