Packagecom.bourre.utils
Classpublic class ClassUtils

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Set of class utilities functions.



Public Methods
 MethodDefined by
  
inherit(childClass:Class, parentClass:Class):Boolean
[static] Verify that the passed-in childClass is a descendant of the specified parentClass.
ClassUtils
  
isImplemented(o:Object, classPath:String, f:String):Boolean
[static] Use the isImplemented function to check if a virtual method of an abstract class is really implemented by children classes.
ClassUtils
  
isImplementedAll(o:Object, classPath:String, ... rest):Boolean
[static] Check in one time if a set of function is implemented by the subclasses.
ClassUtils
Method detail
inherit()method
public static function inherit(childClass:Class, parentClass:Class):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Verify that the passed-in childClass is a descendant of the specified parentClass.

Parameters
childClass:Class — class to check inheritance with the ascendant class
 
parentClass:Class — class which is the ascendant

Returns
Boolean
isImplemented()method 
public static function isImplemented(o:Object, classPath:String, f:String):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Use the isImplemented function to check if a virtual method of an abstract class is really implemented by children classes.

Parameters
o:Object — o A reference to this in the abstract class constructor.
 
classPath:String — f The name of the virtual method.
 
f:String

Returns
Booleantrue if the method is implemented by the child class, either false

Example
A concret example in the class AbstractTween : if( !ClassUtils.isImplementedAll( this, "com.bourre.transitions::AbstractTween", "isMotionFinished", "isReversedMotionFinished" ) ) { PixlibDebug.ERROR ( this + " have to implements virtual methods : isMotionFinished & isReversedMotionFinished " ); throw new UnimplementedVirtualMethodException ( this + " have to implements virtual methods : isMotionFinished & isReversedMotionFinished" ); {}

isImplementedAll()method 
public static function isImplementedAll(o:Object, classPath:String, ... rest):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Check in one time if a set of function is implemented by the subclasses.

Parameters
o:Object — o A reference to this in the abstract class constructor.
 
classPath:String — c A Collection object witch contains a list of function names to verify.
 
... rest

Returns
Booleantrue if all the methods are implemented by the child class, either false. When only one method isn't implemented then the function failed and return immediatly.

See also