/** * Returns all methods that are applicable to actual argument types. * @param methods list of all candidate methods * @param classes the actual types of the arguments * @return a list that contains only applicable methods (number of * formal and actual arguments matches, and argument types are assignable * to formal types through a method invocation conversion). */ private static LinkedList getApplicables(List methods, Class[] classes) { LinkedList list = new LinkedList(); for (Iterator imethod = methods.iterator(); imethod.hasNext();) { Method method = (Method) imethod.next(); if(isApplicable(method, classes)) { list.add(method); } } return list; }
if (isApplicable(method, args))
if (isApplicable(method, args))