1 11 package org.eclipse.jdt.internal.core.search; 12 13 import org.eclipse.jdt.core.*; 14 import org.eclipse.jdt.core.search.*; 15 16 21 public class JavaSearchTypeNameMatch extends TypeNameMatch { 22 23 private IType type; 24 private int modifiers = -1; 26 29 public JavaSearchTypeNameMatch(IType type, int modifiers) { 30 this.type = type; 31 this.modifiers = modifiers; 32 } 33 34 38 public boolean equals(Object obj) { 39 if (obj == this) return true; if (obj instanceof TypeNameMatch) { 41 TypeNameMatch match = (TypeNameMatch) obj; 42 if (this.type == null) { 43 return match.getType() == null && match.getModifiers() == this.modifiers; 44 } 45 return this.type.equals(match.getType()) && match.getModifiers() == this.modifiers; 46 } 47 return false; 48 } 49 50 53 public int getModifiers() { 54 return this.modifiers; 55 } 56 57 62 public IType getType() { 63 return this.type; 64 } 65 66 70 public int hashCode() { 71 if (this.type == null) return this.modifiers; 72 return this.type.hashCode(); 73 } 74 75 80 public void setModifiers(int modifiers) { 81 this.modifiers = modifiers; 82 } 83 84 89 public void setType(IType type) { 90 this.type = type; 91 } 92 93 97 public String toString() { 98 if (this.type == null) return super.toString(); 99 return this.type.toString(); 100 } 101 } 102 | Popular Tags |