org.apache.bsf.util
Class MethodUtils.MoreSpecific
private static
class
MethodUtils.MoreSpecific
extends Vector
Internal Class for getEntryPoint(). Implements 15.11.2.2 MORE
SPECIFIC rules.
Retains a list of methods (already known to match the
arguments). As each method is added, we check against past entries
to determine which if any is "more specific" -- defined as having
_all_ its arguments (not just a preponderance) be
method-convertable into those of another. If such a relationship
is found, the more-specific method is retained and the
less-specific method is discarded. At the end, if this has yielded
a single winner it is considered the Most Specific Method and
hence the one that should be invoked. Otherwise, a
NoSuchMethodException is thrown.
PERFORMANCE VERSUS ARCHITECTURE: Arguably, this should "have-a"
Vector. But the code is 6% smaller, and possibly faster, if we
code it as "is-a" Vector. Since it's an inner class, nobody's
likely to abuse the privilage.
Note: "Static" in the case of an inner class means "Does not
reference instance data in the outer class", and is required since
our caller is a static method.