1 11 package org.eclipse.jdt.internal.ui.text.correction; 12 13 import java.util.Arrays ; 14 15 public class SimilarElement { 16 17 private final int fKind; 18 private final String fName; 19 private final String [] fTypesParameters; 20 private final int fRelevance; 21 22 public SimilarElement(int kind, String name, int relevance) { 23 this(kind, name, null, relevance); 24 } 25 26 public SimilarElement(int kind, String name, String [] typesParameters, int relevance) { 27 fKind= kind; 28 fName= name; 29 fTypesParameters= typesParameters; 30 fRelevance= relevance; 31 } 32 33 37 public int getKind() { 38 return fKind; 39 } 40 41 45 public String [] getTypesParameter() { 46 return fTypesParameters; 47 } 48 49 53 public String getName() { 54 return fName; 55 } 56 57 61 public int getRelevance() { 62 return fRelevance; 63 } 64 65 68 public boolean equals(Object obj) { 69 if (obj instanceof SimilarElement) { 70 SimilarElement elem= (SimilarElement) obj; 71 return fName.equals(elem.fName) && fKind == elem.fKind && Arrays.equals(fTypesParameters, elem.fTypesParameters); 72 } 73 return false; 74 } 75 76 79 public int hashCode() { 80 return fName.hashCode() + fKind; 81 } 82 } 83 | Popular Tags |