/*
// $Id$
// This software is subject to the terms of the Common Public License
// Agreement, available at the following URL:
// http://www.opensource.org/licenses/cpl.html.
// Copyright (C) 2001-2002 Kana Software, Inc.
// Copyright (C) 2001-2005 Julian Hyde and others
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
//
// jhyde, 6 August, 2001
*/

package mondrian.olap;

import org.apache.log4j.Logger;

/**
 * <code>OlapElementBase</code> is an abstract base class for implementations of
 * {@link OlapElement}.
 *
 * @author jhyde
 * @version $Id$
 * @since 6 August, 2001
 */
public abstract class OlapElementBase
        implements OlapElement {

    private String caption = null;

    protected OlapElementBase() {
    }

    protected abstract Logger getLogger();

    public boolean equals(Object o) {
        return (o instanceof OlapElement) &&
                equals((OlapElement) o);
    }

    public boolean equals(OlapElement mdxElement) {
        return getClass() == mdxElement.getClass() &&
                getUniqueName().equalsIgnoreCase(mdxElement.getUniqueName());
    }

    public int hashCode() {
        int i = (getClass().hashCode() << 8),
                j = getUniqueName().hashCode(),
                k = i ^ j;
        return k;
    }

    public String toString() {
        return getUniqueName();
    }

    public Object clone() {
        return this;
    }

    /**
     * Returns the display name of this catalog element.
     * If no caption is defined, the name is returned.
     */
    public String getCaption() {
        if (caption != null) {
            return caption;
        } else {
            return getName();
        }
    }

    /**
     * Sets the display name of this catalog element.
     */
    public void setCaption(String caption) {
        this.caption = caption;
    }
}

// End OlapElementBase.java

@@ -1013,16 +1013,54 @@
  return 
+mdxElement != null &&%0A                
 getClass

Fix bug 1433418 [Assertion failed in Segment.java] -- it occurs when the same column is constrained twice. Refactor how cell-requests are generated, to allow different types of level (parent-child level, regular level, and the levels containing null and all members) to do it their own way. This is a step towards user-defined dimensions. Make RolapMember.equals() a bit more efficient. Disable failing testcase in VirtualCubeTest. Add Schema.removeCube(String cubeName).