@@ -0,0 +1,2557 @@
+/*%0A// $Id$%0A// This software is subject to the terms of the Common Public License%0A// Agreement, available at the following URL:%0A// http://www.opensource.org/licenses/cpl.html.%0A// Copyright (C) 2004-2005 TONBELLER AG%0A// Copyright (C) 2006-2006 Julian Hyde and others%0A// All Rights Reserved.%0A// You must accept the terms of that agreement to use this software.%0A*/%0Apackage mondrian.rolap.agg;%0A%0Aimport mondrian.rolap.RolapMember;%0A%0A/**%0A * A %3Ccode%3EColumnConstraint%3C/code%3E is an Object to constraining a%0A * column (WHERE-Clause) when a segment is loaded.%0A *%0A * @version $Id$%0A */%0Apublic class ColumnConstraint implements Comparable %7B%0A%0A    private final Object value;%0A%0A    /**%0A     * Creates a column constraint.%0A     *%0A     * @param value Value to constraint the column to. (We require that it is%0A     *   %7B@link Comparable%7D because we will sort the values in order to%0A     *   generate deterministic SQL.)%0A     */%0A    public ColumnConstraint(Object value) %7B%0A        assert value != null;%0A        this.value = value;%0A    %7D%0A%0A    public Object getValue() %7B%0A        return value;%0A    %7D%0A%0A    public RolapMember getMember() %7B%0A        return null;%0A    %7D%0A%0A    public int compareTo(Object o) %7B%0A        ColumnConstraint that = (ColumnConstraint) o;%0A        if (this.value instanceof Comparable &&%0A                that.value instanceof Comparable &&%0A                this.value.getClass() == that.value.getClass()) %7B%0A            return ((Comparable) this.value).compareTo(that.value);%0A        %7D else %7B%0A            String thisComp = String.valueOf(this.value);%0A            String thatComp = String.valueOf(that.value);%0A            return thisComp.compareTo(thatComp);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Returns whether this constraint has the same constraining effect as the%0A     * other constraint. This is weaker than %7B@link #equals(Object)%7D -- it is%0A     * possible for two different members to constraint the same column in the%0A     * same way.%0A     */%0A    public boolean equalConstraint(ColumnConstraint that) %7B%0A        return this.value.equals(that.value);%0A    %7D%0A%0A    public boolean equals(Object other) %7B%0A        if (!(other instanceof ColumnConstraint)) %7B%0A            return false;%0A        %7D%0A        final ColumnConstraint that = (ColumnConstraint) other;%0A        if (value != null) %7B%0A            return value.equals(that.getValue());%0A        %7D else %7B%0A            return null == that.getValue();%0A        %7D%0A    %7D%0A%0A    public int hashCode() %7B%0A        if (value != null) %7B%0A            return value.hashCode();%0A        %7D%0A        return 0;%0A    %7D%0A%7D%0A%0A// End ColumnConstraint.java%0A

Rename ColumnConstraint to AbstractColumnPredicate, part I.