Access keys

MethodAlgorithm

Kind of class: class
Inherits from: BasicClass
Author: Simon Wacker
Classpath: org.as2lib.env.reflect.algorithm.MethodAlgorithm
File last modified: Friday, 27 May 2005, 10:10:58
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
org.as2lib.env.reflect.ClassInfo.getMethods method directly and do not have to make the detour
over this class. The org.as2lib.env.reflect.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.

Summary

Constructor
Instance methods
Instance methods inherited from BasicClass

Constructor

MethodAlgorithm

function MethodAlgorithm (
Void)
Constructs a new MethodAlgorithm instance.

Instance methods

execute

function execute (
i:ClassInfo) : Array
Searches for all methods of the passed-in class i.

The resulting array contains instances of type org.as2lib.env.reflect.MethodInfo.

null will be returned if:

  • The passed-in class i is null or undefined.
  • The 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"];

Parameters:
i:
the class info instance representing the class to search through
Returns:
the found methods, an empty array or null