public FunctionInformation[] getFunctions() {
ArrayList functions = new ArrayList();
for (Iterator i = methods.keySet().iterator(); i.hasNext();) {
String key = (String) i.next();
FunctionInformation fi = (FunctionInformation) information.get(key);
if (fi != null) {
functions.add(fi);
continue;
}
IFunction f = (IFunction) methods.get(key);
fi = new FunctionInformation(key);
if (f instanceof InstanceMethod) {
try {
InstanceMethod im = (InstanceMethod) f;
ParameterNameExtractor pne = new ParameterNameExtractor(im.clazz);
String[] names = pne.getParameterNames(im.method);
for (int j = 0; j < names.length; j++) {
fi.addArgument(names[j], im.args[j].getSimpleName());
}
} catch (Exception e) {
}
} else if (f instanceof OverloadedMethod) {
try {
OverloadedMethod om = (OverloadedMethod) f;
InstanceMethod im = om.getFirstMethod();
ParameterNameExtractor pne = new ParameterNameExtractor(im.clazz);
String[] names = pne.getParameterNames(im.method);
for (int j = 0; j < names.length; j++) {
fi.addArgument(names[j], im.args[j].getSimpleName());
}
} catch (Exception e) {
}
}
functions.add(fi);