Java Code Examples for java.lang.reflect.Method.hashCode()

The following are Jave code examples for showing how to use hashCode() of the java.lang.reflect.Method class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Phoenix-for-VK   File: EventHandler.java   View Source Code Vote up 6 votes
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();
}
 
Example 2
Project: UniversalEventBus   File: RxEventProducer.java   View Source Code Vote up 6 votes
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();
}
 
Example 3
Project: UniversalEventBus   File: RxEventHandler.java   View Source Code Vote up 6 votes
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();
}
 
Example 4
Project: android-project-gallery   File: EventProducer.java   View Source Code Vote up 6 votes
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();
}
 
Example 5
Project: android-project-gallery   File: EventHandler.java   View Source Code Vote up 6 votes
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();
}
 
Example 6
Project: lams   File: AdvisedSupport.java   View Source Code Vote up 4 votes
public MethodCacheKey(Method method) {
	this.method = method;
	this.hashCode = method.hashCode();
}