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.IVariableBinding; 16 17 import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType; 18 19 24 public final class VariableVariable2 extends ConstraintVariable2 implements ISourceConstraintVariable { 25 26 private final String fKey; 27 private ICompilationUnit fCompilationUnit; 28 29 public VariableVariable2(TType type, IVariableBinding binding) { 30 super(type); 31 fKey= binding.getKey(); 32 } 33 34 public void setCompilationUnit(ICompilationUnit unit) { 35 fCompilationUnit= unit; 36 } 37 38 public ICompilationUnit getCompilationUnit() { 39 return fCompilationUnit; 40 } 41 42 public String getKey() { 43 return fKey; 44 } 45 46 49 public int hashCode() { 50 return fKey.hashCode(); 51 } 52 53 56 public boolean equals(Object other) { 57 if (this == other) 58 return true; 59 if (other.getClass() != VariableVariable2.class) 60 return false; 61 62 return fKey.equals(((VariableVariable2) other).getKey()); 63 } 64 } 65 | Popular Tags |