1 26 27 package org.objectweb.util.browser.core.naming; 28 29 30 import org.objectweb.util.browser.core.api.Name; 31 32 39 public abstract class AbstractName extends AbstractObject implements Name { 40 41 47 53 59 65 79 public boolean equals(Object obj) { 80 if (obj instanceof Name) 81 return equals((Name) obj); 82 else 83 return super.equals(obj); 84 } 85 86 92 101 public void toStringBuffer(StringBuffer sb) { 102 sb.append("id="); 103 sb.append(getOWId()); 104 sb.append(",subname="); 105 sb.append(getOWSubName()); 106 } 107 108 114 123 public abstract String getOWId(); 124 125 134 public abstract Name getOWSubName(); 135 136 152 public boolean equals(Name name) { 153 return (name == this) || (name.getOWId().equals(this.getOWId()) && name.getOWSubName().equals(getOWSubName())); 154 } 155 156 } 157 | Popular Tags |