Finding best Method in Class for param list
I have a Class I want to query for a Method, the name of the method I want and the set of parameters I wish to pass to the method. Because of inheritnce, my parameter list may not exactly match any of the class's published methods, even though a java compiler would be able to use inheritance to find a best match.
For example,
abstractpublicclass House
{
abstractboolean isWindowOpen(int windowIndex);
abstractvoid setYardBounds(Rectangle bounds);
}
If I were to call House.class.getMethod("setYardBounds", Rectangle2D.Float.class)
a NoSuchMethodException is thrown. Similarly, House.class.getMethod("isWindow", Integer.class)
will fail.
I would like to determine the 'closest match' method; that is, the method the Java compiler would pick if it were to find the matching method for my parameter list. Is there an easy way to do this?

