1 11 package org.eclipse.core.runtime; 12 13 25 public final class QualifiedName { 26 27 28 29 String qualifier = null; 30 31 32 33 String localName = null; 34 35 45 public QualifiedName(String qualifier, String localName) { 46 Assert.isLegal(localName != null && localName.length() != 0); 47 this.qualifier = qualifier; 48 this.localName = localName; 49 } 50 51 63 public boolean equals(Object obj) { 64 if (obj == this) { 65 return true; 66 } 67 if (!(obj instanceof QualifiedName)) { 68 return false; 69 } 70 QualifiedName qName = (QualifiedName) obj; 71 72 if (qualifier == null && qName.getQualifier() != null) { 73 return false; 74 } 75 if (qualifier != null && !qualifier.equals(qName.getQualifier())) { 76 return false; 77 } 78 return localName.equals(qName.getLocalName()); 79 } 80 81 86 public String getLocalName() { 87 return localName; 88 } 89 90 96 public String getQualifier() { 97 return qualifier; 98 } 99 100 105 public int hashCode() { 106 return (qualifier == null ? 0 : qualifier.hashCode()) + localName.hashCode(); 107 } 108 109 113 public String toString() { 114 return (getQualifier() == null ? "" : getQualifier() + ':') + getLocalName(); } 116 } 117 | Popular Tags |