1 11 package org.eclipse.core.internal.properties; 12 13 import org.eclipse.core.runtime.IPath; 14 15 public class ResourceName { 16 protected String qualifier = null; 17 protected IPath path = null; 18 19 public ResourceName(String qualifier, IPath path) { 20 super(); 21 this.qualifier = qualifier; 22 this.path = path; 23 } 24 25 public boolean equals(Object other) { 26 if (this == other) 27 return true; 28 if (!(other instanceof ResourceName)) 29 return false; 30 ResourceName otherName = (ResourceName) other; 31 if (qualifier == null) { 32 if (otherName.getQualifier() != null) 33 return false; 34 } else if (!qualifier.equals(otherName.getQualifier())) 35 return false; 36 return path.equals(otherName.getPath()); 37 } 38 39 public IPath getPath() { 40 return path; 41 } 42 43 public String getQualifier() { 44 return qualifier; 45 } 46 47 public int hashCode() { 48 return path.hashCode(); 49 } 50 51 public String toString() { 52 return getQualifier() + " " + getPath().toString(); } 54 } 55 | Popular Tags |