1 13 14 package mondrian.olap; 15 16 import org.apache.log4j.Logger; 17 18 26 public abstract class OlapElementBase 27 implements OlapElement { 28 29 private String caption = null; 30 31 protected OlapElementBase() { 32 } 33 34 protected abstract Logger getLogger(); 35 36 public boolean equals(Object o) { 37 return (o == this) || 38 ((o instanceof OlapElement) && equals((OlapElement) o)); 39 } 40 41 public boolean equals(OlapElement mdxElement) { 42 return mdxElement != null && 43 getClass() == mdxElement.getClass() && 44 getUniqueName().equalsIgnoreCase(mdxElement.getUniqueName()); 45 } 46 47 public int hashCode() { 48 int i = (getClass().hashCode() << 8), 49 j = getUniqueName().hashCode(), 50 k = i ^ j; 51 return k; 52 } 53 54 public String toString() { 55 return getUniqueName(); 56 } 57 58 public Object clone() { 59 return this; 60 } 61 62 66 public String getCaption() { 67 if (caption != null) { 68 return caption; 69 } else { 70 return getName(); 71 } 72 } 73 74 77 public void setCaption(String caption) { 78 this.caption = caption; 79 } 80 } 81 82 | Popular Tags |