Class related utility methods.
public static function getClass(obj:Object):Class
Parameters
Returns
public static function getClassByName(cname:String):Class
Parameters
Returns
public static function getClassName(obj:Object):String
Get the full class name, e.g. "com.threerings.util.ClassUtil".
Calling getClassName with a Class object will return the same value as calling it with an
instance of that class. That is, getClassName(Foo) == getClassName(new Foo()).
Parameters
Returns
public static function isAssignableAs(asClass:Class, srcClass:Class):Boolean
Returns true if an object of type srcClass is a subclass of or
implements the interface represented by the asClass paramter.
if (ClassUtil.isAssignableAs(Streamable, someClass)) {
var s :Streamable = (new someClass() as Streamable);
Parameters
| asClass:Class |
|
| srcClass:Class |
Returns
public static function isSameClass(obj1:Object, obj2:Object):Boolean
Parameters
Returns
public static function newInstance(obj:Object):Object
Return a new instance that is the same class as the specified
object. The class must have a zero-arg constructor.
Parameters
Returns
public static function shortClassName(obj:Object):String
Get the class name with the last part of the package, e.g. "util.ClassUtil".
Parameters
Returns
public static function tinyClassName(obj:Object):String
Get just the class name, e.g. "ClassUtil".
Parameters
Returns
Copyright © 2007-2009 Three Rings Design, Inc.