Access keys

ClassUtil

Kind of class: class
Inherits from: BasicClass
Author: Martin Heidegger, Simon Wacker
Classpath: org.as2lib.util.ClassUtil
File last modified: Saturday, 02 July 2005, 22:43:52
ClassUtil contains fundamental operations to efficiently and easily
work with any class.
All methods here are supposed to be used with functions
treated as classes.

Summary

Instance methods
Instance methods inherited from BasicClass

Class methods

createCleanInstance

static function createCleanInstance (
clazz:Function) : Object
Creates a new instance of the passed-in clazz without invoking its
constructor.
Parameters:
clazz:
the class to create a new instance of
Returns:
new instance of the passed-in class.
Author:
Martin Heidegger
Ralf Bokelberg (www.qlod.com)

createInstance

static function createInstance (
clazz:Function, args:Array)
Creates a new instance of the passed-in clazz applying the
passed-in args to the constructor.

This util is mostly made for MTASC compatibility because it doesn't
allow new clazz() for usual variables.

Parameters:
clazz:
Class to be instanciated
args :
Arguments to be applied to the constructor
Returns:
new instance of the class

isImplementationOf

static function isImplementationOf (
clazz:Function, interfaze:Function) : Boolean
Checks if the passed-in clazz implements the passed-in * interfaze.
Parameters:
clazz :
the class to check
interfaze:
the interface the clazz may implement
Returns:
true if the passed-in clazz implements the passed-in
interfaze else false

isSubClassOf

static function isSubClassOf (
subClass:Function, superClass:Function) : Boolean
Checks if the passed-in subClass is extended by the passed-in
superClass.
Parameters:
subClass :
the class to check
superClass:
the class to match
Returns:
true if subClass is a sub-class of superClass