1 11 12 package org.eclipse.jdt.internal.corext.refactoring.typeconstraints2; 13 14 import org.eclipse.jdt.core.ICompilationUnit; 15 import org.eclipse.jdt.core.dom.IMethodBinding; 16 17 import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType; 18 19 23 public final class ReturnTypeVariable2 extends ConstraintVariable2 implements ISourceConstraintVariable { 24 25 private final String fKey; 26 private ICompilationUnit fCompilationUnit; 27 28 public ReturnTypeVariable2(TType type, IMethodBinding binding) { 29 super(type); 30 fKey= binding.getKey(); 31 } 32 33 public String getKey() { 34 return fKey; 35 } 36 37 40 public int hashCode() { 41 return getKey().hashCode(); 42 } 43 44 47 public boolean equals(Object other) { 48 if (this == other) 49 return true; 50 if (other.getClass() != ReturnTypeVariable2.class) 51 return false; 52 53 ReturnTypeVariable2 other2= (ReturnTypeVariable2) other; 54 return getKey().equals(other2.getKey()); 55 } 56 57 public void setCompilationUnit(ICompilationUnit unit) { 58 fCompilationUnit= unit; 59 } 60 61 public ICompilationUnit getCompilationUnit() { 62 return fCompilationUnit; 63 } 64 } 65 | Popular Tags |