next up previous contents
Next: 13.3.3 Œ^”»’胁ƒ\ƒbƒh Up: 13.3 Šî’êƒNƒ‰ƒXObject Previous: 13.3.1 Object::Class

13.3.2 Object::IsInstanceOf(aClass)

Object::IsInstanceOf(aClass) ‚́Aˆø”‚ɃNƒ‰ƒX(aClass)‚ðŽæ‚èA‚  ‚éƒCƒ“ƒXƒ^ƒ“ƒX‚ª‚»‚̃Nƒ‰ƒX‚©‚琶¬‚³‚ꂽ‚à‚Ì‚©‚Ç‚¤‚©‚̐^‹U’l‚ð•Ô‚µ‚Ü‚·B

aClass‚ªƒCƒ“ƒXƒ^ƒ“ƒX‚̐¶¬Œ³ƒNƒ‰ƒXA‚ ‚é‚¢‚́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) $\Longrightarrow$ ^
a->IsInstanceOf(B) $\Longrightarrow$ ‹U
a->IsInstanceOf(C) $\Longrightarrow$ ‹U
b->IsInstanceOf(A) $\Longrightarrow$ ^
b->IsInstanceOf(B) $\Longrightarrow$ ^
b->IsInstanceOf(C) $\Longrightarrow$ ‹U
c->IsInstanceOf(A) $\Longrightarrow$ ^
c->IsInstanceOf(B) $\Longrightarrow$ ‹U
c->IsInstanceOf(C) $\Longrightarrow$ ^

‚Ü‚½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)


next up previous contents
Next: 13.3.3 Œ^”»’胁ƒ\ƒbƒh Up: 13.3 Šî’êƒNƒ‰ƒXObject Previous: 13.3.1 Object::Class
Tetsuo Ono
1998-11-05