org.as2lib.core.BasicClass +--org.as2lib.env.reflect.algorithm.MethodAlgorithm
MethodAlgorithm
searches for all methods of a specific class.
This class is mostly used internally. If you wanna obtain the methods of a class you need its representing ClassInfo. You can then also use the ClassInfo.getMethods method directly and do not have to make the detour over this class. The ClassInfo.getMethods method is also easier to use and offers some extra functionalities.
If you nevertheless want to use this class here is how it works.
var classInfo:ClassInfo = ClassInfo.forClass(MyClass);
var methodAlgorithm:MethodAlgorithm = new MethodAlgorithm();
var methods:Array = methodAlgorithm.execute(classInfo);
Refer to the execute method for details on how to get data from the methods array appropriately.
public function execute(i:ClassInfo):Array
Searches for all methods of the passed-in class i
.
The resulting array contains instances of type MethodInfo.
null
will be returned if:
i
is null
or undefined
. getType
method of the passed-in class returns null
.Only the passed in class will be searched through, no super classes.
The found methods are stored in the resulting array by index as well as by
name. This means you can obtain MethodInfo
instances either by index:
var myMethod:MethodInfo = myMethods[0];
Or by name:
var myMethod:MethodInfo = myMethods["myMethodName"];
i | the class info instance representing the class to search through |
the found methods, an empty array or null