Cache chaches classes and packages.
The caching of classes and packages leads to better performance. You also
must cache them because for example the parent of two classes residing in the
same package should be the same PackageInfo instance.
The cache is mostly used internally. But you can also use it to add
ClassInfo or PackageInfo instances directly so that they do not
have to be searched for. This can improve the performance dramatically with
classes or packages that are needed quite often.
public function getClassByClass(clazz:Function):ClassInfo
Returns the class info representing the passed-in clazz.
null will be returned if:
ClassInfo instance cached. clazz is null or undefined.clazz | the class to return the class info for |
the class info representing the passed-in clazz
public function getClassByInstance(instance):ClassInfo
Returns the class info representing the class the instance was
instantiated of.
null will be returned if:
ClassInfo instance cached. instance is null or undefined.instance | the instance to return the appropriate class info for |
the class info representing the instance's class
public function addClass(classInfo:ClassInfo):ClassInfo
Adds the passed-in classInfo to the list of cached class infos and returns
this classInfo.
classInfo | the class info to add |
the passed-in and added classInfo
public function getPackage(package):PackageInfo
Returns the package info representing the passed-in package.
null will be returned if:
PackageInfo instance cached. package is null or undefined.package | the package to return the appropriate package info for |
the pakcage info representing the passed-in package
public function addPackage(packageInfo:PackageInfo):PackageInfo
Adds the passed-in packageInfo to this cache and returns this added
packageInfo.
packageInfo | the package info to add |
the passed-in and added packageInfo
public function getRoot(Void):PackageInfoReturns the root package of the whole package hierarchy.
The root package is also refered to as the default package.
The root/default package determines where the ClassAlgorithm and
PackageAlgorithm classes start their search.
the root/default package