ClassUtils
| Kind of class: | public class |
|---|---|
| Package: | com.bourre.utils |
| Inherits from: | none |
| Author: | Cédric Néhémie |
| Classpath: | com.bourre.utils.ClassUtils |
| File last modified: | Monday, 24 November 2008, 11:36:51 |
Summary
Class methods
- inherit (childClass:Class, parentClass:Class) : Boolean
- Verify that the passed-in childClass is a descendant of the
- isImplemented (o:Object, classPath:String, f:String) : Boolean
- Use the isImplemented function to check if a virtual method of an abstract
- isImplementedAll (o:Object, classPath:String, rest) : Boolean
- Check in one time if a set of function is implemented by the subclasses.
Class methods
inherit
public static function inherit (
childClass:Class,
parentClass:Class) : Boolean
Verify that the passed-in
specified
childClass is a descendant of the specified
parentClass. Parameters:
childClass :
class to check inheritance with the ascendant class
parentClass:
class which is the ascendant
isImplemented
public static function isImplemented (
o:Object,
classPath:String,
f:String) : Boolean
Use the
class is really implemented by children classes.
isImplemented function to check if a virtual method of an abstractclass is really implemented by children classes.
Parameters:
o:
A reference to
this in the abstract class constructor.f:
The name of the virtual method.
Returns:
-
trueif the method is implemented
by the child class, eitherfalse
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
public static function isImplementedAll (
o:Object,
classPath:String,
rest) : Boolean
Check in one time if a set of function is implemented by the subclasses.
Parameters:
o:
A reference to
this in the abstract class constructor.c:
A
names to verify.
Collection object witch contains a list of functionnames to verify.
Returns:
-
trueif all the methods are implemented
by the child class, eitherfalse. When
only one method isn't implemented then the function
failed and return immediatly.
See also: