public abstract class MethodKey
extends Object
An abstract base class for a key used for comparators and Map keys to look up a method by name and parameter types
| Type Params | Return Type | Name and description |
|---|---|---|
|
public MethodKey |
createCopy()Creates an immutable copy that we can cache. |
|
protected int |
createHashCode()Computes an uncached hash from the name, each parameter type, the super-call flag, and the sender. |
|
public boolean |
equals(Object that) |
|
public boolean |
equals(MethodKey that)Compares sender, super-call flag, name, parameter count, and parameter types. |
|
public String |
getName()Returns the method name passed to the constructor. |
|
public abstract int |
getParameterCount()Returns how many parameter types this key has. |
|
public abstract Class |
getParameterType(int index)Returns the parameter type at index.
|
|
public List |
getParamterTypes()Returns the parameter types in index order. |
|
public int |
hashCode() |
|
public String |
toString() |
Creates an immutable copy that we can cache.
Computes an uncached hash from the name, each parameter type, the super-call
flag, and the sender. Each step multiplies by 37. A parameter contributes
1 + type.hashCode(), the super-call flag contributes 1 or 0, and the
sender contributes 1 + sender.hashCode(). hashCode() caches
this value and substitutes 0xcafebabe when the computed value is 0.
Compares sender, super-call flag, name, parameter count, and parameter types.
The senders are compared with !=. Each parameter type is compared
by identity, not by Class.equals.
A null that fails immediately.
that - the other keytrue when the sender, super-call flag, name, count, and each
parameter type matchReturns the method name passed to the constructor.
Returns how many parameter types this key has.
Returns the parameter type at index.
equals(MethodKey) compares these classes by identity.
index - zero-based parameter indexReturns the parameter types in index order. A count of zero or less yields Collections.EMPTY_LIST, which cannot be modified. Otherwise the result is a new ArrayList and is not a view of this key.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.