isXXX
boolean isXXX() { return this instanceof XXX; } and a set of cast functions (asXXX), which are essentially: XXX asXXX() { if(isXXX()) return (XXX)this; else return null; }
and a set of cast functions (asXXX), which are essentially: XXX asXXX() { if(isXXX()) return (XXX)this; else return null; }
asXXX
XXX asXXX() { if(isXXX()) return (XXX)this; else return null; }