View Javadoc

1   /**
2    * 
3    */
4   package org.sourceforge.jemm.client.events;
5   
6   import org.sourceforge.jemm.client.Descriptor;
7   
8   /**
9    * A context that represents a particular method for an Entity.
10   * 
11   * This class is thread safe.
12   * 
13   * @See EntityContext
14   * @See Context
15   * @author Paul Keeble
16   *
17   */
18  public class MethodContext extends SimpleContext {
19  	Descriptor method;
20  	
21  	public MethodContext(Descriptor method) {
22  		if(method==null)
23  			throw new IllegalArgumentException("method may not be null");
24  		this.method = method;
25  	}
26  
27  	@Override
28  	public boolean equals(Object obj) {
29  		if (!(obj instanceof MethodContext))
30  			return false;
31  
32  		MethodContext other = (MethodContext) obj;
33  		return method.equals(other.method);
34  	}
35  	
36  	public int hashCode() {
37  		return method.hashCode();
38  	}
39  
40  	public synchronized String toString() {
41  		return method +" " + tracked;
42  	}
43  
44  }