本文整理汇总了Java中java.lang.reflect.Method.hashCode方法的典型用法代码示例。如果您正苦于以下问题:Java Method.hashCode方法的具体用法?Java Method.hashCode怎么用?Java Method.hashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang.reflect.Method
的用法示例。
在下文中一共展示了Method.hashCode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EventHandler
import java.lang.reflect.Method; //导入方法依赖的package包/类
public EventHandler(Object target, Method method) {
if (target == null) {
throw new NullPointerException("EventHandler target cannot be null.");
}
if (method == null) {
throw new NullPointerException("EventHandler method cannot be null.");
}
this.target = target;
this.method = method;
method.setAccessible(true);
// Compute hash code eagerly since we know it will be used frequently and we cannot estimate the runtime of the
// target's hashCode call.
final int prime = 31;
hashCode = (prime + method.hashCode()) * prime + target.hashCode();
}
示例2: RxEventProducer
import java.lang.reflect.Method; //导入方法依赖的package包/类
RxEventProducer(Object target, Method method) {
if (target == null) {
throw new NullPointerException("EventProducer target cannot be null.");
}
if (method == null) {
throw new NullPointerException("EventProducer method cannot be null.");
}
this.target = target;
this.method = method;
method.setAccessible(true);
// Compute hash code eagerly since we know it will be used frequently and we cannot estimate the runtime of the
// target's hashCode call.
final int prime = 31;
hashCode = (prime + method.hashCode()) * prime + target.hashCode();
}
示例3: RxEventHandler
import java.lang.reflect.Method; //导入方法依赖的package包/类
RxEventHandler(Object target, Method method) {
if (target == null) {
throw new NullPointerException("EventHandler target cannot be null.");
}
if (method == null) {
throw new NullPointerException("EventHandler method cannot be null.");
}
this.target = target;
this.method = method;
method.setAccessible(true);
// Compute hash code eagerly since we know it will be used frequently and we cannot estimate the runtime of the
// target's hashCode call.
final int prime = 31;
hashCode = (prime + method.hashCode()) * prime + target.hashCode();
}
示例4: EventProducer
import java.lang.reflect.Method; //导入方法依赖的package包/类
EventProducer(Object target, Method method) {
if (target == null) {
throw new NullPointerException("EventProducer target cannot be null.");
}
if (method == null) {
throw new NullPointerException("EventProducer method cannot be null.");
}
this.target = target;
this.method = method;
method.setAccessible(true);
// Compute hash code eagerly since we know it will be used frequently and we cannot estimate the runtime of the
// target's hashCode call.
final int prime = 31;
hashCode = (prime + method.hashCode()) * prime + target.hashCode();
}
示例5: EventHandler
import java.lang.reflect.Method; //导入方法依赖的package包/类
EventHandler(Object target, Method method) {
if (target == null) {
throw new NullPointerException("EventHandler target cannot be null.");
}
if (method == null) {
throw new NullPointerException("EventHandler method cannot be null.");
}
this.target = target;
this.method = method;
method.setAccessible(true);
// Compute hash code eagerly since we know it will be used frequently and we cannot estimate the runtime of the
// target's hashCode call.
final int prime = 31;
hashCode = (prime + method.hashCode()) * prime + target.hashCode();
}
示例6: MethodCacheKey
import java.lang.reflect.Method; //导入方法依赖的package包/类
public MethodCacheKey(Method method) {
this.method = method;
this.hashCode = method.hashCode();
}