001/*
002// This software is subject to the terms of the Eclipse Public License v1.0
003// Agreement, available at the following URL:
004// http://www.eclipse.org/legal/epl-v10.html.
005// You must accept the terms of that agreement to use this software.
006//
007// Copyright (C) 1998-2005 Julian Hyde
008// Copyright (C) 2005-2012 Pentaho and others
009// All Rights Reserved.
010*/
011package mondrian.olap;
012
013import java.util.List;
014
015/**
016 * Represents Cell Property.
017 *
018 * @author Shishir
019 * @since 08 May, 2007
020 */
021
022public class CellProperty extends QueryPart {
023    private String name;
024
025    public CellProperty(List<Id.Segment> segments) {
026        this.name = Util.implode(segments);
027    }
028
029    /**
030     * checks whether cell property is equals to passed parameter.
031     * It adds '[' and ']' before and after the propertyName before comparing.
032     * The comparison is case insensitive.
033     */
034    public boolean isNameEquals(String propertyName) {
035        return name.equalsIgnoreCase(Util.quoteMdxIdentifier(propertyName));
036    }
037
038    public String toString() {
039        return name;
040    }
041}
042
043// End CellProperty.java