Various small fixes.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4258 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-07-12 02:22:18 +00:00
parent 78cefe9a8f
commit 2f3584adf7
5 changed files with 32 additions and 2 deletions
+10
View File
@@ -21,6 +21,16 @@ public class ClassUtil
return s.replace("::", ".");
}
/**
* Return a new instance that is the same class as the specified
* object. The class must have a zero-arg constructor.
*/
public static function newInstance (obj :Object) :Object
{
var clazz :Class = getClass(obj);
return new clazz();
}
public static function getClass (obj :Object) :Class
{
return getClassByName(getClassName(obj));